All Collections
Credentials & Rewards
Credentials 101 🍎
Custom Credentials 🧑‍🔬
API Integration for Streamlined Data Management: Simplify Your Credentialing Process
API Integration for Streamlined Data Management: Simplify Your Credentialing Process

Efficiently manage credentials with Galxe's API integration. Streamline data exchange and simplify your credentialing process.

Operation Team avatar
Written by Operation Team
Updated over a week ago

In today's fast-paced world, streamlining data management is crucial. Manual updates to your credentialing data can be time-consuming and prone to errors. By integrating Galxe's API, you can automate your credentialing process, and reduce manual intervention all while saving valuable time and effort.

Galxe's API allows you to receive verification requests in real time whenever someone completes a task. There is no limit to the number of values, making this a great option for managing large datasets. As long as your endpoint returns a JSON-parseable response, this API tool will work. You can also define your own logic for determining whether to return a true or false response to Galxe.


Before integrating Galxe's API, you need to create a credential that you want to use in your campaign.

Import your own Data

  1. Select Import Your Own Data from the Credential Dashboard.

  2. Select the ID Type of your upload.
    This option can only be selected once. It enables our system to recognize and verify the type of data you provide.

  3. Enter a title that accurately describes the data source for the credential.

  4. Select API for Credential Source.

  5. Enter a brief summary of the credential that will be displayed on the campaign page and the credential page.

  6. Enter the URL associated with the call-to-action where users can complete the credential, such as your app, a Gleam or Google Form link, or any other relevant link.

  7. Click "Save" to save the credential.

Note: After creating your credential in Galxe, you will be redirected to the page displaying your newly created credential. The URL of this page will contain a number string, which is the credID. The credID is necessary for creating your API. Make sure to take note of this number as you will need it later on.


To generate an access token, go to the Galxe user setting page and follow these steps:

  1. Log in to your Galxe account and click on your profile icon located at the top right corner of the screen. From the dropdown menu, select "Settings" and you will be redirected to the settings page.

  2. Scroll down until you find the "Access Token" section.

  3. Make sure to copy your access token and keep it in a secure place as you will need it to use the API.

Note: Only space admins or owners will be able to generate the access token needed to use Galxe's API.


Endpoint

Galxe's API uses GraphQL as its endpoint, which provides a more efficient and flexible way to query and manipulate data. GraphQL allows you to specify exactly what data you need and provides a consistent structure for retrieving that data. This makes it easier to integrate with other systems and reduces the amount of data transmitted over the network.

To use Galxe's API, you will need to send a GraphQL query or mutation to the API endpoint, along with an access token for authentication. The access token must belong to a space admin or owner who has access to update the credential items.

The input for the API includes the following mandatory parameters:

For more information on Galxe's GraphQL endpoint, please refer to the documentation provided by Galxe.

Input

  1. access-token: a header string that is used to authenticate the user with the access token.

  2. credId: an integer that represents the credential ID you want to update.

  3. operation: an enum string that specifies the type of operation you want to perform

    1. APPEND, append items in the list.

    2. REPLACE, remove all items and replace them with items in the list.

    3. REMOVE, remove items from the list.

  4. items: a string array that contains the list of items (addresses or emails) to be modified, depending on the operation you choose.

GraphQL

mutation {
credentialItems(
input: {
credId: "312"
operation: APPEND
items: [
"0x111fd6240381af2c5f1a9e27f282bae8b92b257"
"0x222dde76Cf5752f2bc1DC798BA1369dcA49d7c79"
"0x333eC1a5d0BC3C4291aeb962CBda49677E9a9FcB"
"0x444022af64bfc0f59ce1069e4ab51aa15148e60b"
"0x55526ef96b12fba7a507afba39bdfc78e0039742"
"0x6662c6b59e87b302b43400303427acd50f8071e6"
"0x777742ee649ee36edcf5ac9a97df34333a97fd24"
"0x8886b92fda46b8d9d33ca28d8837e1661edf8b97"
"0x999886e265cf2ec39f8868d7b6c67ab78e027736"
]
}
) {
eligible(address:"0x999886e265cf2ec39f8868d7b6c67ab78e027736")
}
}

Example

Node.js

const credId = "123";
const operation = "APPEND";
const items = ["0x123"];

// Nodejs using Axios lib
let axiosRes = await axios.post("https://graphigo.prd.galaxy.eco/query", {
operationName: "credentialItems",
query: `
mutation credentialItems($credId: ID!, $operation: Operation!, $items: [String!]!)
{
credentialItems(input: {
credId: $credId
operation: $operation
items: $items
})
{
name
}
}
`,
variables: {
// Make sure this is string type as int might cause overflow
credId: credId,
operation: operation,
items: items
},
},
{
headers: {
"access-token": "access-token-of-yours",
}
}
);

console.log(axiosRes.data);

Did this answer your question?