Pular para conteúdo

API Reference

Getting the Catalog of an Environment

The catalog is a list of all of the content available in an environment. You may want to use this catalog to keep track of which pieces of content has been updated in your environment

Request

End Point

GET https://api.getjoystick.com/api/v1/env/catalog
You do not need to specify an environment in the endpoint because each API Key is already uniquely associated with the environment it was created in.

Request Attribute Value Required Notes
Content-Type application/json yes
x-api-key Your API key yes The API key you created for the environment you are targeting. This is different for each environment. Created and managed in the Environment page.

Body

None Required.

Example

curl --location --request GET 'https://api.getjoystick.com/api/v1/env/catalog \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: YOUR-API-KEY'

Response

200 OK
{
  "catalog": {
    "config_01": {
      "h": "0774d8c6",
      "d": false
    },
    "config_02": {
      "h": "89344718",
      "d": false
    },
    "config_03": {
      "h": "b20c0078",
      "d": true
    }
  }
}   
Request Attribute Description
catalog This is the root object. A dictionary of objects, the key is each ContentId in the environment, the body is metadata about that piece of content.
.h The hash of the latest version of the content. You can use this to check if your cached copy is the most up to date.
.d A boolean flag indicating if this piece of content has a dynamic mapping attached, and potentially segmentation or ab-testing activated.

Using the Catalog API

When you retrieve any individual piece of content, that response will also return a content hash. You can then use the hash on the catalog API to periodically check if the copy you have locally is the most up-to-date and decide if to refresh it from Joystick again.

Please refer to our Integration Guide for more information!