Onboard Your Users
Register your users to grant them access to marketplace features, chain assets, and interactions with GameShift’s payment flows. All that is needed is a valid email address for the user. Note, this email address will be used for transaction approval, so you should validate that the user can access it.
Make a POST http request to https://api.gameshift.dev/v2/users
using your API key. Pass the user’s email address and a referenceId
in the request body:
curl --request POST \
--url https://api.gameshift.dev/users \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-api-key: <your key here>' \
--data '
{
"referenceId": "exampleReferenceId",
"email": "[email protected]"
}
'
Each referenceId
must be a unique value. We recommend using a format compatible with your own authentication system, such as UUIDs or other generated ids.
If successful, you’ll receive a response with the details you provided, plus an address for the user’s on-chain wallet:
{
"referenceId": "exampleReferenceId",
"email": "[email protected]"
}
Once a user is registered, their information and assets can be fetched at any time.
Fetch a user’s assets by making a GET http request to https://api.gameshift.dev/v2/users/{the-user-id-you-used-to-register}/assets
:
curl --request GET \
--url https://api.gameshift.dev/users/exampleReferenceId/assets \
--header 'accept: application/json' \
--header 'x-api-key: <your api key>'
If successful, you’ll receive a paginated list of the user’s assets:
{
"data": [
{
"id": "dcde5bc8-b30b-46b6-b4da-0763953b2484",
"collectionId": "36c97125-04a5-4dc3-b92a-029d74a42287",
"attributes": [],
"name": "Example Asset",
"description": "Example Description",
"imageUrl": "https://solana.com/src/img/branding/solanaLogoMark.png",
"status": "Committed",
"owner": {
"address": "<user’s wallet address>",
"referenceId": "exampleReferenceId"
}
}
],
"meta": {
"page": 1,
"perPage": 50,
"totalPages": 1
}
}
Updated 7 months ago