Learn how to generate multi-language images in seconds with Bannerly!See Bannerly.io

API: Customer API

Last modified: September 13, 2021Author: Jakub Pomykała

In this section you will learn how to create, query, update and delete customers. Customers feature is used to change translations for one company or user without altering your base translations.

Resources

POST Create customer

https://api.simplelocalize.io/api/v1/customers

Example cURL

curl 
    --location 
    --request POST 'https://api.simplelocalize.io/api/v1/customers' \
    --header 'X-SimpleLocalize-Token: <API_KEY>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "key": "my-customer-2137",
        "description": "My favourite customer is just reading this text ☺️"
    }'

Request fields

  • key (required) - customer identifier, must be unique for a project (max 40 characters),
  • description (optional) - more details about the customer (max 255 characters),

Example response

{
  "msg": "OK",
  "status": 200,
  "data": {
    "key": "my-customer-2137",
    "description": "My favourite customer is just reading this text ☺️"
  }
}

GET Get one customer

https://api.simplelocalize.io/api/v1/customers/{customerKey}

Example cURL

curl 
    --location 
    --request GET 'https://api.simplelocalize.io/api/v1/customers/{customerKey}' \
    --header 'X-SimpleLocalize-Token: <API_KEY>' \
    --header 'Content-Type: application/json'

Example response

{
  "msg": "OK",
  "status": 200,
  "data": {
    "key": "my-customer-2137",
    "description": "My favourite customer is just reading this text :)"
  }
}

GET Get all customers

Endpoint returns all available customers in the project.

https://api.simplelocalize.io/api/v1/customers

Example cURL

curl 
    --location 
    --request GET 'https://api.simplelocalize.io/api/v1/customers' \
    --header 'X-SimpleLocalize-Token: <API_KEY>' \
    --header 'Content-Type: application/json'

Example response

{
  "msg": "OK",
  "status": 200,
  "data": [
    {
      "key": "my-customer-2137",
      "description": "My favourite customer is just reading this text :)"
    },
    {
      "key": "my-customer-1004",
      "description": "Some description for my-customer-1004"
    }
  ]
}

PATCH Update customer

https://api.simplelocalize.io/api/v1/customers/{customerKey}

Example cURL

curl 
    --location 
    --request PATCH 'https://api.simplelocalize.io/api/v1/customers/my-customer-2137' \
    --header 'X-SimpleLocalize-Token: <API_KEY>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "key": "my-customer-2137-modified",
        "description": "My favourite customer is just reading this text ☺️"
    }'

Example response

{
  "msg": "OK",
  "status": 200,
  "data": {
    "key": "my-customer-2137-modified",
    "description": "My favourite customer is just reading this text :)"
  }
}

DELETE Delete customer

https://api.simplelocalize.io/api/v1/customers/{customerKey}

Example cURL

curl 
    --location 
    --request DELETE 'https://api.simplelocalize.io/api/v1/customers/my-customer-2137' \
    --header 'X-SimpleLocalize-Token: <API_KEY>' \
    --header 'Content-Type: application/json'

Example response

{
  "msg": "OK",
  "status": 200
}