Import API

Authentication

To successfully connect to our REST API, you need an API token (CustomerScore Key). You can generate your token in the Customerscore.io application under the Settings/API section. Keep this token secret and stored in a safe place!

Request header requirements:

Content-Type: application/json
customerscore-key: "your-generated-key"

Please ensure to include the generated token in the request header as customerscore-key. Additionally, specify Content-Type: application/json in the header.

API Reference:
link to reference

Upload customers data:

URL: https://api.customerscore.io/api/v1/customers
Method: POST

Example of body request:

{
  "customers": [
    {
      "external_id": "12345",
      "name": "Knapp-Cruz Inc.",
      "admin_link": "https://app.example.com/12345",
      "crm_link": "https://crm.example.com/12345",
      "scorings": [
        {
          "date": "2024-04-29", // Must be unique for each item in "scorings" array
          "property_codename_from_your_app": "abcd", // String value
          "property_codename_from_your_app": 1234, // Number value
          "property_codename_from_your_app": true // Boolean value
        }
      ]
    }
  ]
}

Maximum request body size is limited to 5 MB. The customers field is mandatory in the JSON body. Each customer object within the customers array must include the following attributes:

  • external_id: Identifier for the customer, mandatory, max 255 characters.
  • name: Name of the customer, mandatory, max 255 characters.

Optionally, you can include the following attributes for each customer:

  • admin_link: Administrative link related to the customer.
  • crm_link: CRM link related to the customer.

You can include up to 100 customers in a single API request.

The scorings field, which contains the data used for calculating scores, is also mandatory. It can contain a maximum of 200 items. The only mandatory attribute within each item is the date on which the scoring will be calculated.

Here’s an example structure of one item in the scorings array:

{
	"date": "2024-04-29",
	"country": "Czechia",
        "has_picture": true,
	"resolved_tickets": 39,
	"number_of_connections": 50
}

Each key in this object corresponds to the codename property configured in the Customerscore.io application under the Settings/Properties section.

Please note that the key must precisely match the codename property, and it is case-sensitive. Only keys that match will be stored in the application, and a score will be calculated from their values, or they will be utilized differently according to the settings in the application.

Upon successful data import, internal processing will occur, and all users in the account will receive a notification regarding the newly imported customers data.

Responses:

Code	Description
200	The customers data has been successfully received and forwarded for processing.
400	Bad request
401	Unauthorized. Missing parameter 'customerscore-key' in the header
403	Forbidden. Invalid key
405	Method Not Allowed, only POST method is allowed
406	Not Acceptable
490     Unconfigured scoring