跳转至

Common Issues and Troubleshooting

When making a request to Joystick to get configuration content, you may get a 400, 401 or other error response. Here are some common issues and solutions.

  • Make sure the endpoint is correct and it is a POST request.
  • Make sure the headers and API Key are correct.
  • Make sure the request body is sent correctly.
  • Make sure the contentId is available in the same environment as the API Key has been provisioned for.

Make sure the endpoint is correct and it is a POST request.

Generally, you'll want to use the dynamic content endpoint. This requires a POST request.

POST https://api.getjoystick.com/api/v1/config/:contentId/dynamic

Make sure the headers are correct.

The request requires two headers Content-Type and X-Api-Key.

Request Attribute Value Required Notes
Content-Type application/json Yes
X-Api-Key Your API Key Yes The API key created for the environment you are targeting. This is different for each environment.

Make sure the request body is sent correctly.

Please see below for some correct and incorrect examples of the body.

// ✅ Simply an empty root object is fine.
{}

// ✅ A body with only the "u". It can be any string. Typically a UUID or some other individual identifier.
{
    "u": ""
}

// ✅ "u" as an empty string, "p" as an empty object.
{
    "u": "",
    "p": {}
}

// ✅ A body that has all of the optional components.
{
    "u": "the-unique-user-id",
    "v": "3.2.1",
    "p": {
        "level": 1,
        "location": "north_pole",
        "balance": 101,
        "days_since_install": 14,
        "collectibles": ["bear", "tiger", "fish"]
    }
}   
// 🚫 "p" cannot be an array.
{
    "u": "",
    "p": []
}

// 🚫 "p" as anything other than an object. 
{
    "u": "",
    "p": 1234
}

// 🚫 "v" as a number
{
    "v": 12 // version must be sent in three-part semantic version as a string.
}   

Make sure the contentId is available in the environment the API Key has been provisioned for.

In Joystick each API Key only has access to content of the environment it was provisioned for. For example, if you create a piece of content in "Development" environment, then create a key in "Production" environment, that new key will not be able to retrieve the configuration content unless the content has been pushed/synched to "Production". Joystick provides a full suite of tools sync configuration content between different environments, including review and multi-user approval processes.

Config missing in Environment

Still having issues? Reach out!

Click below to over to our Discord server for tips, support and more!

Discord