Skip to content

Commit 9c2f053

Browse files
committed
Updated API from documentation release
1 parent 447e10d commit 9c2f053

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"id": "ac390383-370f-43f8-a534-db1604cb96a8",
3+
"key": "commercetools",
4+
"version": 2,
5+
"name": {
6+
"en": "New Name"
7+
},
8+
"roles": [
9+
"InventorySupply"
10+
],
11+
"createdAt": "2015-05-28T09:48:35.023Z",
12+
"lastModifiedAt": "2015-06-02T09:48:35.023Z"
13+
}

api-specs/api/resources/channels.raml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,48 @@ post:
6060
body:
6161
application/json:
6262
example: !include ../examples/channel-update.example.json
63+
responses:
64+
200:
65+
body:
66+
application/json:
67+
example: !include ../examples/channel-updated.example.json
68+
delete:
69+
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
70+
description: |
71+
Returns a [ReferenceExists](ctp:api:type:ReferenceExistsError) error if other resources reference the Channel to be deleted.
72+
responses:
73+
200:
74+
body:
75+
application/json:
76+
example: !include ../examples/channel.example.json
77+
78+
/key={key}:
79+
(methodName): withKey
80+
type:
81+
baseResource:
82+
uriParameterName: key
83+
resourceType: Channel
84+
resourceUpdateType: ChannelUpdate
85+
get:
86+
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
6387
responses:
6488
200:
6589
body:
6690
application/json:
6791
example: !include ../examples/channel.example.json
92+
head:
93+
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
94+
description: Checks if a Channel exists for a given `key`. Returns a `200 OK` status if the Channel exists or a `404 Not Found` otherwise.
95+
post:
96+
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
97+
body:
98+
application/json:
99+
example: !include ../examples/channel-update.example.json
100+
responses:
101+
200:
102+
body:
103+
application/json:
104+
example: !include ../examples/channel-updated.example.json
68105
delete:
69106
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
70107
description: |

api-specs/graphql/schema.sdl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5571,8 +5571,20 @@ type Mutation {
55715571
"Queries with specified key"
55725572
key: String): Category
55735573
createChannel(draft: ChannelDraft!): Channel
5574-
updateChannel(id: String!, version: Long!, actions: [ChannelUpdateAction!]!): Channel
5575-
deleteChannel(id: String!, version: Long!): Channel
5574+
updateChannel(version: Long!, actions: [ChannelUpdateAction!]!,
5575+
5576+
"Queries with specified ID"
5577+
id: String,
5578+
5579+
"Queries with specified key"
5580+
key: String): Channel
5581+
deleteChannel(version: Long!,
5582+
5583+
"Queries with specified ID"
5584+
id: String,
5585+
5586+
"Queries with specified key"
5587+
key: String): Channel
55765588
createOrUpdateCustomObject(draft: CustomObjectDraft!): CustomObject
55775589
deleteCustomObject(version: Long,
55785590

0 commit comments

Comments
 (0)