Follow guide ⏭️

GET /navigation/guide/{search_id}/{locale}/follow/{step}

This endpoint is the core of the guided search. It has a double use case:

  • Get a question of a given step with possible choices
  • Answer to a question of a given step with user choices, in that case the next question + choices is returned directly

It is meant to be used several times in a row to follow the guide until the end, or until the user wants to stop it and show results immediately

Path parameters

  • search_id string Required

    The search_id as returned by the Initialize guide endpoint.

  • locale string Required

    The locale in which to go through the guide. It can be changed at any step of the guide. 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.

  • step string Required

    The step for which we want to get the question or the step we want to answer to. If you're not answering a given step, use current to automatically jump to latest step.

Query parameters

  • The string representation of the choice(s) made by the user for the question at the given step. For multiple choices, allowed combinations are given by available_combination_mode attribute of the question. In order to build the final choice_key, you'll need to concatenate the choice keys with

    • ~ char for and combination
    • | char for or combination

    If the question is marked as skippable, it can be skipped by using skip as a choice

    If you want to go back to the previous proposed question, you should use back as a choice

Responses

  • 200 application/json

    Submit choices for a given question, and get next question with its choices

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

      Additional properties are allowed.

      Hide result attributes Show result attributes object
      • context object

        Additional properties are allowed.

      • question object

        Additional properties are allowed.

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

          Unique key to identify the choice

        • label string

          Choice key translation (depending of the locale)

        • The URL of the choice pictogram

        • The number of products affected by this choice

GET /navigation/guide/{search_id}/{locale}/follow/{step}
curl \
 -X GET https://api.ppe-analytics.com/api/v1/navigation/guide/2e254ef2-3e63-4cb2-9680-3876b68e7191/it/follow/2 \
 -H "PPEApiKey: $API_KEY"
Response examples (200)
{
  "status": "OK",
  "result": {
    "context": {
      "step": 2,
      "locale": "it",
      "search_id": "2e254ef2-3e63-4cb2-9680-3876b68e7191",
      "product_count": 262,
      "api_follow_guide": "/api/v1/navigation/guide/2e254ef2-3e63-4cb2-9680-3876b68e7191/it/follow/3",
      "api_back_question": "/api/v1/navigation/guide/2e254ef2-3e63-4cb2-9680-3876b68e7191/it/follow/3?choice_key=_back_",
      "api_guide_results": "/api/v1/navigation/guide/2e254ef2-3e63-4cb2-9680-3876b68e7191/it/results",
      "api_skip_question": "/api/v1/navigation/guide/2e254ef2-3e63-4cb2-9680-3876b68e7191/it/follow/3?choice_key=_skip_",
      "custom_pictos_only": true
    },
    "question": {
      "key": "search-by-manufacturer",
      "label": "Ricerca per produttore",
      "picto_url": "https://app.ppe-analytics.com/static/pictos/300/fc6d75d7-8366-424e-b526-4bc333a390b5.jpg",
      "is_back_allowed": true,
      "is_skip_allowed": true,
      "available_combination_mode": "or"
    },
    "choices": [
      {
        "key": "manufacturer-1",
        "label": "Produttore n°1",
        "picto_url": "https://app.ppe-analytics.com/static/pictos/300/fc6d75d7-8366-424e-b526-4bc333a390b5.jpg",
        "product_count": 20
      },
      {
        "key": "manufacturer-2",
        "label": "Produttore n°2",
        "picto_url": "https://app.ppe-analytics.com/static/pictos/300/fc6d75d7-8366-424e-b526-4bc333a39585.jpg",
        "product_count": 55
      },
      {
        "key": "manufacturer-3",
        "label": "Produttore n°3",
        "picto_url": "https://app.ppe-analytics.com/static/pictos/300/fc6d75d7-8366-424e-b526-4bc333a39585.jpg",
        "product_count": 187
      }
    ]
  }
}