Skip to main content

One post tagged with "platform-api"

View All Tags

· 3 min read
Chris Palmer

With the introduction of our Environments feature, all MTRIBES Spaces are now available in Development, Staging, and Production variants. To complement this, we've made some changes to our SDKs and the Platform API.

Continue reading to learn about the new changes and how to upgrade to the latest SDK and Platform API.

SDK#

You are now required to specify the target environment when initializing a client SDK. To do so, provide the API key associated with the target environment, found on your Space settings page.

If you haven't done so and are using the Browser SDK, an error will be logged and default fallback states will be served. If you're using Android or iOS, you will receive a compiler error.

Note: Regardless of what environment API key you specify, any fallbacks served will always be for the Production environment. Learn more about fallbacks in our SDKs.

To learn more about how to upgrade your code to use the environments feature, see the following guides:

  1. Browser
  2. iOS
  3. Android

Note: Currently, the Roku SDK does not support configuration of the target environment, so it will default to Production.

Collection publishing

You will need to ‘Publish’ any pre-existing Collections in the Staging & Development environments for them to work correctly.

Platform API V2#

The biggest difference between our Platform API V1 and V2 is the addition of the Environment Resource. There have also been some changes to the existing User Resource as users and visitors are now scoped at the environment level.

The Environment Resource lists environments available for your Space (Development, Staging or Production):

GET /v2/spaces/:spaceId/environments

The User resource has been moved to underneath the Environment resource. To manage users belonging to a particular environment, you must specify the API key for that environment in path parameters:

GET /v2/spaces/:spaceId/environments/:envKey/users

Upgrade Steps#

  1. Switch to the Platform API V2.

    Change v1.0 to v2 in the request URL.

    Existing:

    GET https://api.mtribes.com/v1.0/orgs   

    New:

    GET https://api.mtribes.com/v2/orgs
  1. Include the environment keyword when managing users.

    For User Resource requests, include the environment keyword in the path: /environments/{production/development/staging}

    Existing:

    GET https://api.mtribes.com/v1.0/spaces/87930769-ea4c-439c-ba6a-abe9a4559f29/users

    New:

    GET https://api.mtribes.com/v2/spaces/87930769-ea4c-439c-ba6a-abe9a4559f29/environments/production/users
  2. Manage users and visitors in different environments.

    If you wish to manage users on a different environment to production, use either staging or development as the environment keyword in the request path.

    GET https://api.mtribes.com/v2/spaces/87930769-ea4c-439c-ba6a-abe9a4559f29/environments/development/users

    Or:

    GET https://api.mtribes.com/v2/spaces/87930769-ea4c-439c-ba6a-abe9a4559f29/environments/staging/users

Learn more about the Platform API.

End of life#

The Platform API V1 will be deprecated by February 2022. If you still require access to this version of the API, refer to the Platform API Documentation V1.