Exercise 4a: Running a One-Off Access Request
Authorization: administration token or client token Endpoint information: Access request for elastic tokens |
This step demonstrates how an application run by the customer Lisa Barry requests the following items using the elastic/api/v1.0/instances/{instanceId}/access-request endpoint:
• | 10 counts of PhotoPrint, version 1.0 |
• | 2 counts of CADPrint, version 2.0 |
You need to pass the {instanceId} as a path parameter to identify the specific instance from which you request line items.
This form of access request is intended for single use of the requested items. It does not initiate a session or result in repeated charges for the items over time. It is also not possible to "return" the items or obtain a full or partial refund for the tokens charged. For more information about sessions, see Sessions.
Item |
Description |
URI |
elastic/api/v1.0/instances/{instanceId}/access-request |
Method |
POST |
Path parameters |
instanceId: Use the ID returned by the /provisioning/api/v1.0/instances API In the Exercise 2: Identifying the Instance, the instance ID d889a651-123a-456b-78d9-60d6de8cfes9 was returned. |
Request body |
|
Sample Response
The sample response displays information about the requested items, PhotoPrint and CADPrint. The line item with activation ID ACT01-Elastic was charged 44 tokens in total:
• | 10 counts at a rate of 3 = 30 tokens for PhotoPrint |
• | 2 counts at a rate of 7 = 14 tokens for CADPrint. |
{
"correlationId": "5c8ec4fd-f17f-4657-bf09-74a97ddc9f8b",
"requester": {
"type": "user",
"value": "LisaBarry"
},
"requestedItems": [
{
"item": "PhotoPrint",
"requestedVersion": "1.0",
"count": 10,
"status": {
"code": "101",
"description": "Successfully checked out"
},
"totalTokensCharged": 30,
"lineItems": [
{
"rate": 3,
"activationId": "ACT01-Elastic",
"tokensCharged": 30
}
]
},
{
"item": "CADPrint",
"requestedVersion": "2.0",
"count": 2,
"status": {
"code": "101",
"description": "Successfully checked out"
},
"totalTokensCharged": 14,
"lineItems": [
{
"rate": 7,
"activationId": "ACT01-Elastic",
"tokensCharged": 14
}
]
}
]
}
See also