Conversational AI

Talk to your assistant: B2B scenario

This page describes the steps to get started using the Conversational AI API in a B2B scenario:

Step 1: Anonymous register

Anonymous register/login method request example:

curl -X POST "" \
-H  "accept: application/json" \
-H  "Accept-Language: es-ES" \
-H  "Time-Zone: Europe/Madrid" \
-H  "X-Sherpa-timestamp: 1548084514112" \
-H  "X-Sherpa-hmac: xxxxyyyyyyy***signature******" \
-H  "content-type: application/json" \
-d "{
    \"externalId\": \"\",
    \"name\": \"demo\",

Response example:

    "token": "XXXX-SHERPA-TOKEN-XXXX",
    "type": "basic",
    "expires": :1858915823282,
    "username": "demo"

HTTP code 201 should be obtained in the first call. If a second call is made, HTTP code 200 will be returned.

Step 2: Talk to your assistant

Call the conversational service using the obtained security token:

curl -X POST "" \
-H  "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX" \
-H "Sherpa-Request-Info:{\"lat\":43.3017218,\"lon\":-2.9735617}" \
-H  "Accept-Language: en-US" \
-H  "Time-Zone: Europe/Madrid" \
-H  "accept: application/json" \
-H  "content-type: application/json" \
-d "{\"q\":\"Play a song by U2\"}"

Response example:

  "nextActions": [{
    "action": "PLAY_MUSIC",
    "data": {
      "url": ""
  "context": {
    "id": "ffb6eede-8d59-4c15-a380-c4bebf92dfa8",
    "ref": 406370837,
  "responses": {
    "audio": "",
    "html": "<html xmlns=\"\" lang=\"es\" xml:lang=\"es\">... </html>",
    "query": "Play a song by U2",
    "speech": "Playing \"With Or Without You\" by \"U2\"",
    "ssml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><speak xmlns=\"\" xmlns:xsi=\"\" version=\"1.0\" xml:lang=\"en\" xsi:schemaLocation=\"\"><voice gender=\"male\">Playing \"With Or Without You\" by \"U2\" </voice></speak>",
    "text": "Playing \"With Or Without You\" by \"U2\""

You will get the action "PLAY_MUSIC" in the nextActions field and the URL with the song to play.

Play a song

For specific API information, demos, or requests, please contact us at