Skip to main content

Manage multiple API keys

Last updated on October 23, 2024

Overview

In AccelByte Development Toolkit (ADT), you can enable your users to set different operations in a game. We introduced the ability to create and use multiple API Keys for a game. Each API Key has its own scope or permission limit. A scope is congruent with the CRUD (create, read, update, and delete) operations. You can tweak each API Key to the user's needs using a resource or REST endpoint set for allowed operations. For example, you can use one API Key in a game distribution for public use to report crashes, and a private API Key for developers.

Follow these instructions to use this feature.

Prerequisite

Only Admin users have access to the multiple API Key feature.

Add a new API Key

To add a new API Key, follow these steps:

  1. Go to Game Settings, then to the API Key Management menu.

    Image showing game settings and api key management menus

  2. Click Add New and a pop-up will display.

    Add new API key pop-up

  3. Fill in the API Key Name and then add the new resources.

    Add new API key panel showing the Resource section

  4. To use the API Key to access specific features, choose one of the following resources:
    NAMESPACE:{namespace}:GAME:{gameId}:METADATA
    NAMESPACE:{namespace}:GAME:{gameId}:BUILD
    NAMESPACE:{namespace}:GAME:{gameId}:VERSION
    NAMESPACE:{namespace}:GAME:{gameId}:CHANNEL

    NAMESPACE:{namespace}:GAME:{gameId}:SESSION

    NAMESPACE:{namespace}:GAME:{gameId}:STREAM
    NAMESPACE:{namespace}:GAME:{gameId}:BUILD:SYMBOL

    NAMESPACE:{namespace}:GAME:{gameId}:CRASH

    NAMESPACE:{namespace}:GAME:{gameId}:PROFILING

    NAMESPACE:{namespace}:GAME:{gameId}:SYMBOL

    note

    You can only use one resource per box. If you need multiple boxes, add a new resource for each.

  5. To use the API Key to access all features, use this string:

    NAMESPACE:{namespace}:GAME:{gameId}:\*

  6. Add more resources as needed and click the tick box in the appropriate CRUD column(s) for each resource.

  7. Click the Add button. The new API Key is created.

  8. Save the API Key somewhere safe as this is the only time you'll see it.

    A new API key successfully added panel

Use the new API Key

Your new API Key is ready to be used with the features and permissions you have set. To give you an example of how your key might work, let's say you have created a new API Key with the resources and permissions shown below:

Image showing the Resource section of the A new API Key successfully added panel

You can use the API Key to check the available version of the CLI, but will only have read permissions, as shown below.

Panel showing read permissions

This example shows an error resulting from the use of your new API Key to create, update, or delete the version.

Example of an error resulting from use of a new API key

Add more API Keys

To add more API Keys, repeat the steps 1-8 above. Select the resources and permissions that are tied to the new key.

Delete an API Key

To delete an API Key, click on the trash bin icon.

Image of the trash can icon

Click Delete on the message box to confirm you want to delete the API Key. The API Key is deleted.

Delete API Key panel showing the delete key