You are on page 1of 7

Contents

Test Data...............................................................................................................................................2
Obtaining a token..................................................................................................................................2
Calling Order Details API via Gateway...................................................................................................3
Orders by CustomerId.......................................................................................................................3
Order by CustomerId and Order Reference.......................................................................................3
Calling Customer Profile API via Gateway..............................................................................................5
Calling Interaction Builder API via Gateway...........................................................................................6
Create live chat request data.............................................................................................................6
Send a POST request..........................................................................................................................6
Sample data.......................................................................................................................................6
Test Data
Username Password Customer Id
ccsarahstudent@asos.com asos123456 241007484
test15_qa@asos.com asos123456 201655977

Obtaining a token

1. Go to https://test.asosservices.com/?x-site-origin=env02pt.asosdevelopment.com
2. Log in using credentials from the above table
3. Once logged in, open developer tools (F12 in Edge or Chrome) and run this in the console:
await asos.sdk.identity.getAccessToken()
4. Copy the token
Calling Order Details API via Gateway

Orders by CustomerId
Send a GET request to the following URL:

https://care-gatewayapi-v1-pt.asosdevelopment.com/care/gatewayapi/v1/
orderdetails/commerce/myaccount/v1/customers/{customerId}/orders

Replace {customerId} with an actual Customer ID value.

Authorization: Bearer Token

Necessary headers:

asos-gateway-key: 6b62e430badc4ae48df8626574208e0f

Authorization: Bearer {token}

Sample data:

CustomerId: 241007484

cURL code:

curl --location --request GET 'https://care-gatewayapi-v1-pt.asosdevelopment.com/
care/gatewayapi/v1/orderdetails/commerce/myaccount/v1/customers/241007484/orders' 
\

--header 'asos-gateway-key: 6b62e430badc4ae48df8626574208e0f ' \

--header 'Authorization: Bearer {token}'

Order by CustomerId and Order Reference


Send a GET request to the following URL:

https://care-gatewayapi-v1-pt.asosdevelopment.com/care/gatewayapi/v1/orderdetails/
commerce/myaccount/v1/customers/{customerId}/orders/{OrderReference}

Replace {customerId} with an actual Customer ID value.

Replace {OrderReference} with an actual Order Reference value.

Authorization: Bearer Token

Necessary headers:

asos-gateway-key: 6b62e430badc4ae48df8626574208e0f

Authorization: Bearer {token}


Sample data:

CustomerId: 241007484

Order Ref: 5UZ1E8YVZS3K

cURL code:

curl --location --request GET 'https://care-gatewayapi-v1-pt.asosdevelopment.com/
care/gatewayapi/v1/orderdetails/commerce/myaccount/v1/customers/241007484/orders/
5UZ1E8YVZS3K\

--header 'asos-gateway-key: 6b62e430badc4ae48df8626574208e0f' \

--header 'Authorization: Bearer {token}'
Calling Customer Profile API via Gateway

Send a GET request to the following URL:

https://care-gatewayapi-v1-pt.asosdevelopment.com/care/gatewayapi/v1/
customerprofile/customer/profile/v2/customers/{customerId}

Replace {customerId} with an actual Customer ID value.

Authorization: Bearer Token

Necessary headers:

asos-gateway-key: 6b62e430badc4ae48df8626574208e0f

Authorization: Bearer {token}

Sample data:

CustomerId: 241007484

cURL code:

curl --location --request GET


'https://care-gatewayapi-v1-pt.asosdevelopment.com/care/gatewayapi/v1/customerprofile/
customer/profile/v2/customers/241007484' \

--header 'asos-gateway-key: 6b62e430badc4ae48df8626574208e0f' \

--header 'Authorization: Bearer {Token}


Calling Interaction Builder API via Gateway
Create live chat request data
{
"first_name": "Sarah",
"last_name": "Student",
"dob": "string",
"email": "ccsarahstudent@asos.com",
"order_number": "string",
"topic": "string",
"subtopic": "string",
"signed_in": true,
"market": "string",
"customer_id": 241007484,
"telephone": "string",
"nuance_chat_object": {
"conversationData": [
{
"key": "string",
"value": "string"
}
],
"conversationMessage": [
{
"engagementId": "string",
"messageText": "string",
"messageTimestamp": "string",
"isAgentMsg": true
}
]
}

Send a POST request


Send a POST request to the following URL:

https://care-gatewayapi-v1-pt.asosdevelopment.com/care/gatewayapi/v1/
interactionbuilder/care/interactionbuilder/v2/livechat/initiate

With the JSON live chat request data as the body.

Necessary headers:

asos-gateway-key: 6b62e430badc4ae48df8626574208e0f

Authorization: Bearer {Token}

Sample data
curl --location --request POST
'https://care-gatewayapi-v1-pt.asosdevelopment.com/care/gatewayapi/v1/interactionbuilder/
care/interactionbuilder/v2/livechat/initiate' \

--header 'asos-gateway-key: 6b62e430badc4ae48df8626574208e0f ' \


--header 'Content-Type: application/json' \

--header 'Authorization: Bearer {token}’\

--data
'{"first_name":"Sarah","last_name":"Student","dob":"29/07/2021","email":"ccsarahstudent@aso
s.com","order_number":"1234","topic":"Delivery and
Returns","subtopic":"Delivery","signed_in":true,"market":"GB","customer_id":241007484,"tele
phone":"123456","nuance_chat_object":{"conversationData":
[{"key":"key","value":"value"}],"conversationMessage":[{"engagementId":"d4f0bc64-d369-4a9a-
bb70-8fc99db6193f","messageText":"Hi,
ASOS","messageTimestamp":"1627578223","isAgentMsg":false},{"engagementId":"b30cab8b-b18c-
4846-aaee-676581dc0d8c","messageText":"Hi,
Blade","messageTimestamp":"1627578253","isAgentMsg":true}]}}'

You might also like