Authentication

{warning} This authentication API is likely to change in this Beta period, please be aware of this when programming your API. It is most likely that we will require a hashed version of the secret and public keys in the future.

Smart Gift uses API Keys to authenticate requests. You can view and edit your API Keys in the developer section of your Dashboard. These API keys must be kept secret and safe, only those within your organisation with the developer role will be able to see and manage API keys.


You can create API keys for each application that connects to your account, this means that you can terminate any applications access at any time.


Authentication is achieved by supplying the secret key as a header called Smart-Auth in your requests to the Smart Gift API endpoints.


Only requests made using HTTPS will be accepted.

Base URL's

https://api.smart-gift.uk (development)

https://api.smart-gift.co.uk (production)

If you would like access to the Development environment for testing processing of sales etc. please contact support.

Curl

 curl -i -H "Smart-Auth: sk_xxxxxxxxxxxxxx" "Accept: application/json" -H "Content-Type: application/json" https://api.smart-gift.co.uk/

Guzzle

  $client = new Client();
  $response = $client->post(env('API_URL', 'https://api.smart-gift.co.uk/')', [
      'headers' => [
          'Content-Type' => 'application/json',
          'Accept' => 'application/json',
          'Smart-Auth' => 'sk_xxxxxxxxxxxxxx'
      ]
  ]);