PATCH /clients/{authentication}/{client_id}¶
Update authentication and other properties for a client credential.
Path parameters:
Name |
Type |
Description |
---|---|---|
|
string, required |
authentication type (example: hmac) |
|
integer, required |
a client identifier |
Body parameters:
Name |
Type |
Description |
---|---|---|
|
sequence, optional |
An array of client permissions |
|
string, optional, min: 1, max: 255 |
client description |
|
boolean, optional |
indicates if the client was revoked |
|
string, optional, min: 20, max: 20 |
authentication key |
|
integer, optional |
upper limit (in seconds) on signature expiry |
|
boolean, optional, default: false |
readable output formatting |
|
integer, required |
a client identifier |
|
sequence, optional |
add permissions |
|
sequence, optional |
remove permissions |
Updating client permissions:
When patching client permissions only one of the following fields should be used in a request.
Field Name |
Usage Description |
---|---|
permissions |
When specified, the clients entire permissions list is replaced with the list in the request. |
permissions+= |
The list of permissions in field “permissions+=” are added to the clients permission list. |
permissions-= |
The list of permissions in field “permissions-=” are removed from the clients permission list. |
Example request:
This request will update details of a client.
PATCH /clients/hmac/1 HTTP/1.1
Host: api.ereceipts.co.uk
Content-Length: 109
Content-Type: application/json
{
"description": "Fetching receipts",
"permissions+=": [
"view.get_receipt"
],
"revoked": false
}
Example response:
HTTP/1.1 200 OK
Content-Length: 203
Content-Type: application/json
{
"permissions": ["view.get_receipt"],
"description": "Fetching receipts",
"revoked": false,
"key": "SDFGSDFGSDFGSDFGSDFG",
"secret": "99kcY8VaBOzHHH+RfH699r97BsqB1kuFMha/PGPNw95=",
"id": 1
}