Add a challenge history to an ambassador (manager)

POST /manager/ambassadors/{id}/challenge-histories

Path parameters

  • id integer Required

    The ambassador id

application/json

Body

  • points number Required
  • score number Required
  • message string
  • challenge_id number

    The ID of the challenge being completed.

Responses

  • 200 application/json

    success

    Hide response attributes Show response attributes object
    • id integer
    • ambassador object
      Hide ambassador attributes Show ambassador attributes object
      • id_ambassador integer(int32)
      • image string(nullable)
      • full_name string
      • username string(nullable)
      • description string
      • status integer(int32)
      • availability string(nullable)
      • unavailable boolean
      • is_absent boolean
      • absent_msg string(nullable)
      • fb_account string(nullable)
      • twitter_account string(nullable)
      • instagram_account string(nullable)
      • linkedIn_account string(nullable)
      • youtube_account string(nullable)
      • online boolean

        true: when last_action_date is less than 5 minutes ago

      • last_action_date string
    • challenge object
      Hide challenge attributes Show challenge attributes object
      • id integer
      • titles array[object]
        Hide titles attributes Show titles attributes object
        • id_i18n_content integer
        • lang string

          Values are en_GB, fr_FR, es_ES, or de_DE.

        • content string
      • images array[object]
        Hide images attributes Show images attributes object
        • id_i18n_content integer
        • lang string

          Values are en_GB, fr_FR, es_ES, or de_DE.

        • content string
      • descriptions array[object]
        Hide descriptions attributes Show descriptions attributes object
        • id_i18n_content integer
        • lang string

          Values are en_GB, fr_FR, es_ES, or de_DE.

        • content string
      • points number
      • proportional_points boolean
      • nb_wins integer
    • message string
    • score number
    • points number
    • created_at string(date-time)
    • updated_at string(date-time)
  • 401 application/json

    Unauthorized.

    Hide response attribute Show response attribute object
    • message string
  • 403

    Forbidden - You don't have permission to access this route

  • 404

    Not found - The ambassador does not exist

  • 422 application/json

    Unprocessable Content

    Hide response attributes Show response attributes object
    • message string

      Error message.

    • errors object
      Hide errors attributes Show errors attributes object
      • field array[string]

        Error message details.

      • * array[string] Additional properties

        Error message details.

POST /manager/ambassadors/{id}/challenge-histories
curl \
 --request POST 'https://domain.tld/api/v2/manager/ambassadors/{id}/challenge-histories' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"points":42.0,"score":42.0,"message":"string","challenge_id":42.0}'
Request examples
{
  "points": 42.0,
  "score": 42.0,
  "message": "string",
  "challenge_id": 42.0
}
Response examples (200)
{
  "id": 42,
  "ambassador": {
    "id_ambassador": 42,
    "image": "string",
    "full_name": "string",
    "username": "string",
    "description": "string",
    "status": 42,
    "availability": "string",
    "unavailable": true,
    "is_absent": true,
    "absent_msg": "string",
    "fb_account": "string",
    "twitter_account": "string",
    "instagram_account": "string",
    "linkedIn_account": "string",
    "youtube_account": "string",
    "online": true,
    "last_action_date": "string"
  },
  "challenge": {
    "id": 42,
    "titles": [
      {
        "id_i18n_content": 42,
        "lang": "en_GB",
        "content": "Hello"
      }
    ],
    "images": [
      {
        "id_i18n_content": 42,
        "lang": "en_GB",
        "content": "Hello"
      }
    ],
    "descriptions": [
      {
        "id_i18n_content": 42,
        "lang": "en_GB",
        "content": "Hello"
      }
    ],
    "points": 42.0,
    "proportional_points": true,
    "nb_wins": 42
  },
  "message": "string",
  "score": 42.0,
  "points": 42.0,
  "created_at": "2025-05-04T09:42:00Z",
  "updated_at": "2025-05-04T09:42:00Z"
}
Response examples (401)
{
  "message": "Unauthorized."
}
Response examples (422)
{
  "message": "field is required! (and 3 more error)",
  "errors": {
    "field": [
      "Error message details here"
    ],
    "additionalProperty1": [
      "Error message details here"
    ],
    "additionalProperty2": [
      "Error message details here"
    ]
  }
}