PATCH /clients/{authentication}/{client_id}

Update authentication and other properties for a client credential.

Path parameters:

Name

Type

Description

authentication

string, required

authentication type (example: hmac)

client_id

integer, required

a client identifier

Body parameters:

Name

Type

Description

permissions

sequence, optional

An array of client permissions

description

string, optional, min: 1, max: 255

client description

revoked

boolean, optional

indicates if the client was revoked

key

string, optional, min: 20, max: 20

authentication key

signature_max_age

integer, optional

upper limit (in seconds) on signature expiry

pretty

boolean, optional, default: false

readable output formatting

client_id

integer, required

a client identifier

permissions+=

sequence, optional

add permissions

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
}