POST /clients/{authentication}ΒΆ

Create a client credential. The key and secret are optional and if not supplied will be generated by the API. The secret is included in the response and this is the only time the API will return the secret to a client.

Path parameters:

Name

Type

Description

authentication

string, required

authentication type (example: hmac)

Body parameters:

Name

Type

Description

pretty

boolean, optional, default: false

readable output formatting

permissions

sequence, required

An array of client permissions

description

string, required, 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, default: 86400

upper limit (in seconds) on signature expiry

secret

string, optional

authentication secret

Example request:

POST /client/hmac HTTP/1.1
Host: api.ereceipts.co.uk
Content-Length: 200
Content-Type: application/json

{
  "description": "Fetching receipts",
  "key": "SDFGSDFGSDFGSDFGSDFG",
  "permissions": [
    "view.get_receipt"
  ],
  "revoked": false,
  "secret": "99kcY8VaBOzHHH+RfH699r97BsqB1kuFMha/PGPNw95="
}

Example response:

HTTP/1.1 201 Created
Content-Length: 213
Content-Type: application/json; charset=UTF-8
Location: https://api.ereceipts.co.uk/clients/hmac/1

{
  "description": "Fetching receipts",
  "id": "1",
  "key": "SDFGSDFGSDFGSDFGSDFG",
  "permissions": [
    "view.get_receipt"
  ],
  "revoked": false,
  "secret": "99kcY8VaBOzHHH+RfH699r97BsqB1kuFMha/PGPNw95="
}