Credential API
Use API to update credential Items
API credential allows you to push credential data to Galxe for your users.
Prerequisite
- First you need to create a credential that you want to use in your campaign. Please contact the Galxe Support team if you have no access/experience with Galxe dashboard before, they will help you to walk through the concepts of Galxe dashboard and give you access.
- Then you will need an access token bound to your wallet address to use this API. Please go to the Galxe user setting page to generate an access token.
- We’ll check if the access token in the request is valid. First, we’ll find the address bound to the access token and the space to which the requested credential belongs in the request. Then, we’ll verify if the address has permission to access that space. Therefore, please ensure that your wallet address has the necessary permissions to access the space to which the cred belongs. Typically, this would be the space’s owner or admin. You can follow these steps to add an address as a space admin:
- Log in to Galxe using the space owner’s address.
- Navigate to the Settings page in the left sidebar of the space details page.
- Click on the “Accounts” tab in the Settings page.
- Click on “Add new member”.
NOTE: Galxe backend has a rate limit. If request volume is large, please contact us with your external IP so that we can put you on the whitelist. Otherwise, you will encounter 429 error when rate limit is reached.
Endpoint
Input
- (header, string, mandatory) access-token: use to auth if you have access to update credential items, the user with this access token must be the credential curator
- (int, mandatory) credId: the credential id you want to update
- (enum string, mandatory) operation:
- APPEND, append items in the list.
- REPLACE (use only when there is very little addresses in total, e.g., less than 500), remove all items and replace them with items in the list. This operation is not transactional, so DO NOT use if you have a long list of addresses. It is recommended to call REMOVE first then use APPEND.
- REMOVE, remove items from the list.
- (string array, mandatory) items: items list(address or email) to be modified, refer to operation. The length of array must not exceed 500.
NOTE: Always retry when any error is returned. See below example of how to check both GraphQL and HTTP errors. APPEND and REMOVE are re-entrant, so it is ok to just send the query again. REPLACE is not recommended to use.