Skip to content

Commit bc499c5

Browse files
committed
Updated API from documentation release
1 parent 57765b0 commit bc499c5

File tree

5 files changed

+158
-2
lines changed

5 files changed

+158
-2
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"customer": {
3+
"typeId": "customer",
4+
"id": "some-customer-id"
5+
},
6+
"associateRoles": [
7+
{
8+
"id": "first-associate-role-id",
9+
"version": 5,
10+
"createdAt": "2022-04-19T15:36:17.510Z",
11+
"lastModifiedAt": "2022-04-20T15:41:55.816Z",
12+
"key": "admin",
13+
"buyerAssignable": true,
14+
"name": "Admin",
15+
"permissions": [
16+
"UpdateAssociates"
17+
]
18+
},
19+
{
20+
"id": "second-associate-role-id",
21+
"version": 1,
22+
"createdAt": "2022-04-19T15:36:17.510Z",
23+
"lastModifiedAt": "2022-04-20T15:41:55.816Z",
24+
"key": "approver",
25+
"buyerAssignable": true,
26+
"name": "Approver",
27+
"permissions": [
28+
"UpdateApprovalFlows"
29+
]
30+
}
31+
],
32+
"inheritedAssociateRoles": [
33+
{
34+
"id": "inherited-associate-role-id",
35+
"version": 5,
36+
"createdAt": "2022-04-19T15:36:17.510Z",
37+
"lastModifiedAt": "2022-04-20T15:41:55.816Z",
38+
"key": "buyer",
39+
"buyerAssignable": true,
40+
"name": "Buyer",
41+
"permissions": [
42+
"ViewMyQuotes"
43+
]
44+
}
45+
],
46+
"permissions": [
47+
"UpdateAssociates",
48+
"UpdateApprovalFlows",
49+
"ViewMyQuotes"
50+
]
51+
}

api-specs/api/resources/business-units.raml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,46 @@ post:
100100
body:
101101
application/json:
102102
example: !include ../examples/business-unit.example.json
103+
/key={key}/associates/{associateId}:
104+
type: base
105+
uriParameters:
106+
key:
107+
type: string
108+
description: '`key` of the [BusinessUnit](ctp:api:type:BusinessUnit).'
109+
associateId:
110+
type: string
111+
description: '`id` of the [Customer](ctp:api:type:Customer) acting as an Associate in the Business Unit.'
112+
get:
113+
displayName: Get Associate in BusinessUnit by Key
114+
description: |
115+
Retrieves all roles and permissions of an Associate in a Business Unit.
116+
securedBy: [oauth_2_0: { scopes: ['view_business_units:{projectKey}'] }]
117+
responses:
118+
200:
119+
body:
120+
application/json:
121+
type: BusinessUnitAssociateResponse
122+
example: !include ../examples/BusinessUnit/BusinessUnitAssociateResponseExample.json
123+
/{businessUnitId}/associates/{associateId}:
124+
type: base
125+
uriParameters:
126+
businessUnitId:
127+
type: string
128+
description: '`id` of the [BusinessUnit](ctp:api:type:BusinessUnit).'
129+
associateId:
130+
type: string
131+
description: '`id` of the [Customer](ctp:api:type:Customer) acting as an Associate in the Business Unit.'
132+
get:
133+
displayName: Get Associate in BusinessUnit by ID
134+
description: |
135+
Retrieves all roles and permissions of an Associate in a Business Unit.
136+
securedBy: [oauth_2_0: { scopes: ['view_business_units:{projectKey}'] }]
137+
responses:
138+
200:
139+
body:
140+
application/json:
141+
type: BusinessUnitAssociateResponse
142+
example: !include ../examples/BusinessUnit/BusinessUnitAssociateResponseExample.json
103143
/search:
104144
type: base
105145
displayName: Business Unit Search

api-specs/api/resources/in-store.raml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,9 +1957,9 @@ uriParameters:
19571957
displayName: Create a Token for Resetting the Customer's Password in store
19581958
description: |
19591959
Use this method to create a password reset token for a Store-specific Customer during their [password reset process](/../api/customers-overview#customer-password-reset).
1960-
1960+
19611961
Creating a password reset token does not invalidate existing tokens.
1962-
1962+
19631963
If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
19641964
securedBy:
19651965
- oauth_2_0:
@@ -4129,3 +4129,43 @@ uriParameters:
41294129
body:
41304130
application/json:
41314131
example: !include ../examples/business-unit.example.json
4132+
/key={key}/associates/{associateId}:
4133+
type: base
4134+
uriParameters:
4135+
key:
4136+
type: string
4137+
description: '`key` of the [BusinessUnit](ctp:api:type:BusinessUnit).'
4138+
associateId:
4139+
type: string
4140+
description: '`id` of the [Customer](ctp:api:type:Customer) acting as an Associate in the Business Unit.'
4141+
get:
4142+
displayName: Get Associate in BusinessUnit in Store by Key
4143+
description: |
4144+
Retrieves all roles and permissions of an Associate in a Business Unit in a Store.
4145+
securedBy: [oauth_2_0: { scopes: ['view_business_units:{projectKey}'] }]
4146+
responses:
4147+
200:
4148+
body:
4149+
application/json:
4150+
type: BusinessUnitAssociateResponse
4151+
example: !include ../examples/BusinessUnit/BusinessUnitAssociateResponseExample.json
4152+
/{businessUnitId}/associates/{associateId}:
4153+
type: base
4154+
uriParameters:
4155+
businessUnitId:
4156+
type: string
4157+
description: '`id` of the [BusinessUnit](ctp:api:type:BusinessUnit).'
4158+
associateId:
4159+
type: string
4160+
description: '`id` of the [Customer](ctp:api:type:Customer) acting as an Associate in the Business Unit.'
4161+
get:
4162+
displayName: Get Associate in BusinessUnit in Store by ID
4163+
description: |
4164+
Retrieves all roles and permissions of an Associate in a Business Unit in a Store.
4165+
securedBy: [oauth_2_0: { scopes: ['view_business_units:{projectKey}'] }]
4166+
responses:
4167+
200:
4168+
body:
4169+
application/json:
4170+
type: BusinessUnitAssociateResponse
4171+
example: !include ../examples/BusinessUnit/BusinessUnitAssociateResponseExample.json
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#%RAML 1.0 DataType
2+
(package): BusinessUnit
3+
displayName: BusinessUnitAssociateResponse
4+
example: !include ../../examples/BusinessUnit/BusinessUnitAssociateResponseExample.json
5+
type: object
6+
description: |
7+
Information about all roles and permissions of an Associate in a [BusinessUnit](ctp:api:type:BusinessUnit).
8+
properties:
9+
customer:
10+
type: CustomerReference
11+
description: |
12+
The Customer that acts as an Associate in the Business Unit.
13+
associateRoles:
14+
type: AssociateRole[]
15+
description: |
16+
Roles assigned to Associates in the Business Unit.
17+
inheritedAssociateRoles:
18+
type: AssociateRole[]
19+
description: |
20+
Roles inherited by Associates from the parent Business Unit.
21+
permissions:
22+
type: Permission[]
23+
description: |
24+
Permissions the Associate has in the Business Unit.

api-specs/api/types/types.raml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ AssociateRoleInheritanceMode: !include business-unit/AssociateRoleInheritanceMod
8585
BusinessUnit: !include business-unit/BusinessUnit.raml
8686
BusinessUnitApprovalRuleMode: !include business-unit/BusinessUnitApprovalRuleMode.raml
8787
BusinessUnitAssociateMode: !include business-unit/BusinessUnitAssociateMode.raml
88+
BusinessUnitAssociateResponse: !include business-unit/BusinessUnitAssociateResponse.raml
8889
BusinessUnitDraft: !include business-unit/BusinessUnitDraft.raml
8990
BusinessUnitKeyReference: !include business-unit/BusinessUnitKeyReference.raml
9091
BusinessUnitPagedQueryResponse: !include business-unit/BusinessUnitPagedQueryResponse.raml

0 commit comments

Comments
 (0)