Add reference code

Add reference code endpoint is available for adding reference codes only. you can't add/update fields via the API.
Creating and updating reference fields will be done via the UI.

"One-time reference code" field will be added and defined by Gett and is not available via the UI, but the codes can be added via the API

📘

Access token

The Access token should be requested with company.reference scope

Request

Name

Value

Description

URL

https://business-api.gett.com/v1/reference-fields/<referenceFieldId>/codes?businessId=<companyUUID>;

URL for "Add reference code" request

referenceFieldId

UUID

Reference field ID obtained from GETT Support

businessId

UUID

Company UUID identificator obtained from Gett in registration process

curl -XPOST 'https://business-api.gett.com/v1/reference-fields/<referenceFieldId>/codes?businessId=<companyUUID>' \
-data '[{"value":"example Code 1"},{"value":"example Code 2"}]'\
-H "Authorization: Bearer <access token>"

Response

{
  "has_errors": true,
  "data": [
    {
      "id": "9ac06f51-81a8-499d-a6b0-e44c18787747",
      "value": "exampleCode2"
    }
  ],
  "errors": [
    {
      "index": 0,
      "code": "reference_code_invalid",
      "title": "Reference code validation failed",
      "field_errors": [
        {
          "field": "value",
          "code": "reference_code_invalid_format",
          "title": "Code valid characters are letters and 0-9"
        }
      ]
    }
  ]
}

Did this page help you?