Spencer Integration API
    • Spencer Integration API
    • Identity
      • Request access token
        POST
    • News
      • Fetch news publications
        GET
      • Fetch news publications for userlist
        GET
      • Create news draft
        POST
    • Users
      • Create user
        POST
      • Fetch user
        GET
      • Update user
        PUT
      • Delete user
        DELETE
      • Check if user exists
        HEAD
      • Add user profile picture
        POST
      • Create user tag
        POST
      • Update user tag
        PUT
      • Check if user tag exists
        HEAD

    Spencer Integration API

    This documentation explains how to use the Spencer Integration API for fetching and manipulating Spencer data.

    Authentication#

    The API uses the OAuth2 Client Credentials flow to secure the API.
    See Identity > "Request access token" on how to get a valid access token.
    The authentication endpoint requires a valid Client ID and Secret.
    These can be requested via support@spencer.co.

    Environments#

    Spencer has 2 publicly available environments: production (PROD) and staging (STAG).
    The staging environment is only set up for select customers and specific purposes.

    Production environment#

    API host: https://{customer}-api.spencer.co
    Identity host: https://spencermultissov2-production-identity.spencer.co

    Staging environment#

    API host: https://{customer}-stag-api.spencer.co
    Identity host: https://spencermultissov2-staging-identity.spencer.co

    Usage example#

    The example describes how to retrieve news for a specific userlist (e.g. for digital signage purposes).

    Step 1: Get access token#

    POST /auth/oauth2/realms/root/realms/{customer}/access_token
    Host: spencermultissov2-production-identity.spencer.co
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=client_credentials
    &client_id={clientId}
    &client_secret={clientSecret}
    Variables used:
    {customer}: your customer ID
    {clientId} and {clientSecret}: received from Spencer

    Step 2: Fetch news#

    GET /agent/integration/api/v1/news/user-lists/{userListId}/publications
    Host: {customer}-api.spencer.co
    Content-Type: application/json
    Authorization: Bearer {accessToken}
    Variables used:
    {customer}: your customer ID
    {userListId}: the UUID of the userlist, found in the Spencer BO
    {accessToken}: the access token found in the response of the previous API call
    Next
    Request access token
    Built with