Wiki

Case Status
Log In

Wiki

 
List of API Calls»API Call - Clients
  • RSS Feed

Last modified on 16/04/2020 17:00 by User.

Tags:

API Call - Clients

The FindaportAPI has the ability to associate individual API calls to individual clients using individual Client_ids.

There are a number of API calls associated with this:

List all API clients

GET: /api/clients.json(xml)

formats: json, xml

params:

    key - API key

example request:

http://ww.findaport.com/api/clients.json?key=<your_api_key>

example response:
{
  "api_clients": [
    {
      "id": 420,
      "client_id": "35bca557f148b73f859735728a302c",
      "created_at": "2016-08-03T01:53:35.000+00:00",
      "updated_at": "2016-09-09T05:48:32.000+00:00",
      "client_reference": "กฅ༊ἁぁﻆ豈aa00"
    },
    {
      "id": 421,
      "client_id": "f48e56e9c15a290b76f7d4825d7efd",
      "created_at": "2016-09-09T05:47:07.000+00:00",
      "updated_at": "2016-09-09T05:47:07.000+00:00",
      "client_reference": "กฅ༊ἁぁﻆ豈aa01"
    },
    {
      "id": 422,
      "client_id": "1d5ddb2890647281a902f443784a57",
      "created_at": "2016-09-09T05:59:31.000+00:00",
      "updated_at": "2016-09-09T05:59:31.000+00:00",
      "client_reference": "กฅ༊ἁぁﻆ豈aa02"
    }
  ]
}

Create a new API client

POST: /api/clients.json(xml)
formats: json, xml
params:

    key - API key
    client_reference - the reference map to API User's internal system's field. It stores in DB with UTF-16 encoding and has a 30 characters length limit. Should this field be mandatory or uniqueness? Currently it's not.

example request:

http://www.findaport.com/api/clients.json?key=<your_api_key>&client_reference=กฅ༊ἁぁﻆ豈aa02

example response:
{
  "api_client": {
    "id": 523,
    "client_id": "1d5ddb2890647281a902f443784a57",
    "created_at": "2016-09-09T05:59:31.688+00:00",
    "updated_at": "2016-09-09T05:59:31.688+00:00",
    "client_reference": "กฅ༊ἁぁﻆ豈aa02"
  }
}

Update an existing API client

PUT: /api/clients/{client_id}.json(xml)
formats: json, xml
params:

    key - API key
    client_reference - the new client_reference

example request:

http://www.findaport.com/api/clients/35bca557f148b73f859735728a302c.json?key=<your_api_key>&client_reference=กฅ༊ἁぁﻆ豈aa00

example response:

{
    "api_client": {
        "id": 1,
        "client_id": "35bca557f148b73f859735728a302c",
        "created_at": "2016-08-03T01:53:35.000+00:00",
        "updated_at": "2016-09-09T05:48:32.436+00:00",
        "client_reference": "กฅ༊ἁぁﻆ豈aa00"
    }
}