The REST API provides the following methods for accessing the transient state:
GET /api/transientstate
URI |
|
---|---|
Description |
Retrieves all transient state values that are visible to the calling user (in other words, values in lockers for which the caller has read access rights). A valid response is returned even if no transient state is available. The parameter |
Request Header |
|
|
|
Request Body |
None. |
Response Status |
|
Response Body |
Transient state available
{ "data": [ { "key": "myKey1", "locker": { "id": 1, "name": "Locker1" }, "value": "myVal1", "expiry": "2016-05-18T23:17:13Z" }, { "key": "myKey2", "locker": { "id": 1, "name": "Locker1" }, "value": "myVal2" }, { "key": "key3", "locker": { "id": 1, "name": "Locker1" }, "value": "myVal3" } ], "error": null }
No transient state available
{ "data": [], "error": null } |
Access Rights |
'Read transient state REST API'. |
GET /api/transientstate/<key>
URI |
|
---|---|
Description |
Retrieves the specified transient state value using the The parameter The ETag HTTP header is set on the response if the transient state value is returned and contains a hash of the value that can optionally be subsequently used with the PUT method to perform an atomic compare and set rather than an unconditional modification. |
Request Header |
|
|
|
Request Body |
None. |
Response Status |
|
Response Body |
{ "data": { "key": "myKey1", "locker": { "id": 1, "name": "Locker1" }, "value": "myVal1", "expiry": "2016-05-18T23:17:13Z" }, "error": null } |
Access Rights |
'Read transient state REST API'. |
PUT /api/transientstate/<key>
URI |
|
---|---|
Description |
Creates or modifies the specified transient state value for the key provided in URL as The parameter By default, this performs an unconditional modification. However, the If a conditional PUT is performed then the compare and set operation is atomic. |
Request Header |
|
|
|
Request Body |
{ "lockerId": 1, "value": "theValue", "expiry": "2016-05-18T23:17:13Z" } |
Response Status |
|
Response Body | Empty. |
Access Rights |
'Modify transient state REST API'. |