Get segment data model

GET /segments/{segment_key}

The data model of a segment consists of several properties identified by their key. Each property has a type depending on the data it can contain.

Several types are available: boolean, string, enum, enum_list, json, arbo_enum, arbo_enum_list

In the case of types enum and enum_list, the list of possible values is provided, identified by their key.

Path parameters

  • segment_key string Required

    The segment key, as returned by the List segments endpoint.

    Values are hand-protection, foot-protection, head-protection, eye-protection, body-protection, ear-protection, fall-protection, respiratory-protection, ergonomy, safety-first-aid, hygiene, lockout-tagout, electrical, lightening, safety-signs, or surface-cleaning.

Responses

  • 200 application/json

    Successfully returned segment data model

    Hide response attributes Show response attributes object
    • status string
    • result object

      Additional properties are allowed.

      Hide result attributes Show result attributes object
      • segment object

        Additional properties are allowed.

        Hide segment attributes Show segment attributes object
        • key string

          Unique slug to identify the segment

          Values are hand-protection, foot-protection, head-protection, eye-protection, body-protection, ear-protection, fall-protection, respiratory-protection, ergonomy, safety-first-aid, hygiene, lockout-tagout, electrical, lightening, safety-signs, or surface-cleaning.

        • The URL of the pictogram for the segment.

        • The API endpoint to get all available properties of the segment

        • The API endpoint to get all available products of the segment

        • trads object

          Translations for the object. Available languages depend on your corporation settings

          Additional properties are allowed.

          Hide trads attributes Show trads attributes object
      • languages array[string]

        Available languages depend on your corporation settings

        Value is en fr it es de hu ja be pt es fi ro tr pt-BR es-AR.

      • properties array[object]
        Hide properties attributes Show properties attributes object
        • key string

          The slug to identify the property. It is unique segment-wise.

        • type string

          Type of the data handled by the property.

          Value is boolean string enum enum_list json arbo_enum arbo_enum_list.

        • group string

          The group key of this property, mostly for organisation purpose.

        • The URL of the pictogram for the property.

        • trads object

          Translations for the object. Available languages depend on your corporation settings

          Additional properties are allowed.

          Hide trads attributes Show trads attributes object
        • status array[string]

          Status to define the property in more detail

          Value is beta sunset input.

        • values array[object]

          The available values for this property (only for enum and enum_list types).

          Hide values attributes Show values attributes object
          • key string

            The slug for this value. It is unique property-wise.

          • rank integer

            The rank of the value within its siblings

          • The URL of the pictogram for the value.

          • trads object

            Translations for the object. Available languages depend on your corporation settings

            Additional properties are allowed.

            Hide trads attributes Show trads attributes object
  • 404 application/json

    Unknown segment key

    Hide response attributes Show response attributes object
  • 403 application/json

    Unauthorized segment

    Hide response attributes Show response attributes object
GET /segments/{segment_key}
curl \
 -X GET https://api.ppe-analytics.com/api/v1/segments/surface-cleaning \
 -H "PPEApiKey: $API_KEY"
Response examples (200)
{
  "status": "OK",
  "result": {
    "segment": {
      "key": "hand-protection",
      "trads": {
        "en": "Hand protection",
        "fr": "Protection de la main"
      },
      "picto_url": "https://app.ppe-analytics.com/static/pictos/300w/epi-hand.png",
      "api_get_products": "/api/v1/products/hand-protection",
      "api_get_properties": "/api/v1/segments/hand-protection"
    },
    "languages": [
      "en fr it es"
    ],
    "properties": [
      {
        "key": "color",
        "type": "enum_list",
        "group": "description",
        "trads": {
          "de": "Farbe",
          "en": "Color",
          "fr": "Couleur"
        },
        "values": [
          {
            "key": "red",
            "rank": 1,
            "trads": {
              "de": "Rot",
              "en": "Red",
              "fr": "Rouge"
            },
            "picto_url": "https://app.ppe-analytics.com/static/pictos/150w/e32e0f84-7889-414d-ab17-3be2d1f47f9a.jpg"
          },
          {
            "key": "green",
            "rank": 2,
            "trads": {
              "de": "Grün",
              "en": "Green",
              "fr": "Vert"
            },
            "picto_url": "https://app.ppe-analytics.com/static/pictos/150w/5872a29a-0059-4342-82cc-cb1e1965d629.jpg"
          }
        ],
        "picto_url": "https://app.ppe-analytics.com/static/pictos/300w/fc6d75d7-8366-424e-b526-4bc333a390b5.jpg"
      }
    ]
  }
}
Response examples (404)
{
  "status": "ERROR",
  "message": "Unknown segment key 'book-protection'"
}
Response examples (403)
{
  "status": "ERROR",
  "message": "Unauthorized access to segment 'secret-agent'"
}