Page cover

Partners API

Description of the API that can be used by partners to update the NFT

Introduction

A partner API is being developed and allows third party to trigger actions in a NFT collection on Gardenlab.

For now, the API allows partners to trigger NFT creation and reservation for later claim by the user. The claim shall be performed by the user, after logging in with its email. It also allows to consume an interaction on a NFT, designated by the owner's email address. The interaction shall be created and configured beforehand on the collection admin tool.

An API key and a configured collection are required to properly perform those actions.

Swagger demo API : https://api-docs-demo.gardenlab.io/

Description

Configuration

Interactions

post
/saveActionInteraction

Create or update a new interaction and specify the action_id to use to apply the interaction.

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Corps
originstringRequis

The partner's name.

Example: spacex
contract_idstringRequis

The contract ID associated with a specific contract/collection/customer (ex: the event ID or 'subscription')

Example: summer_party
interactionIdstringOptionnel

(optional) The interaction ID to edit. Leave empty to create.

Example: 0ER368760G8787238
Réponses
200

Returns an object containing the interaction information along with its id.

application/json
post
/saveActionInteraction

Operation

User creation

post
/newUserForPartner

Notifies Gardenlab that a user has been created in the database. Create and reserve a NFT for the user, if the conditions are respected. The NFT associated to user_category_id will be used for this user. This endpoint supports body with an array of requests or a single request. The response will be an array or a single body accordingly.

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Corpsobject[]
originstringRequis

The partner's name.

Example: spacex
emailstringRequis

The user's email address. The NFT created will be reserved to this email.

uidstringRequis

The user identification.

user_category_idstringRequis

The user catagory. This defines which NFT to distribute.

Example: VIP
contract_idstringRequis

The contract ID associated with a specific contract/collection/customer (ex: the event ID or 'subscription')

Example: summer_party
Réponses
200

Returns an array of object containing the NFTs created for the user.

application/json
Réponseany of[]
ou
post
/newUserForPartner

Note: When creating a NFT for a user, this NFT is prepared but not minted. The mint of the NFT occurs when the user claims it using the email address.

Action

post
/newActionForUser

Notifies Gardenlab that a user has performed an action in the partner ecosystem

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Corps
originstringOptionnel

The partner's name.

Example: spacex
contract_idstringOptionnel

The contract ID associated with a specific contract/collection/customer (ex: the event ID or 'subscription')

Example: summer_party
action_idstringOptionnel

The action ID.

Example: eshop_purchase
xpIncrementnumberOptionnel

The XP value to add on the NFT. Applied only if the interaction allows it.

Example: 5
Réponses
200

Returns an object containing the NFT created for the user.

application/json
post
/newActionForUser

Note: The action saved for a NFT is applied if the NFT is minted or not.

Mint token

post
/mintTokenForUser

Mint an existing token to a user. The token must be created and allocated to a user, through his email address. The NFT will then be minted to the blockchain address specified in the request. The UID of the user must also be specified for additional security.

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Corps
originstringRequis

The partner's name.

Example: spacex
emailstringRequis

The user's email address. The NFT must have been created with this email.

Example: [email protected]
uidstringRequis

The user identification.

Example: u123456789
user_addrstringRequis

The blockchain address of the user. The NFT will be minted to this address.

Example: 0x0123456789abcdef0123456789abcdef01234567
contract_idstringRequis

The contract ID associated with a specific contract/collection/customer (ex: the event ID or 'subscription')

Example: summer_party
contractstringOptionnel

The contract address. Required if contract_id is not specified. The contract must be associated to the partner.

Example: 0x0123456789abcdef0123456789abcdef01234567
token_idstringOptionnel

The token ID to be minted. It must be reserved to the user. If not specified, the token ID will be searched using the user email.

Example: 123
Réponses
200

Returns the basic information of the mint. The mint is not yet processed in the blockchain.

application/json
post
/mintTokenForUser

Getters

get
/getNftByTokenId

Retrieve the information on a specific NFT of a contract.

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Paramètres de requête
contractstringOptionnel

The contract address of the token.

tokenIdintegerOptionnel

The token ID

Réponses
200

Returns an object containing the NFT information.

Aucun contenu

get
/getNftByTokenId

Aucun contenu

get
/getAllInteractions

Retrieve all the interactions for a contract.

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Paramètres de requête
originstringRequis

The partner's name.

Example: spacex
contractstringOptionnel

The contract for which to retrieve the interactions

Example: 0x0123456789abcdef0123456789abcdef01234567
contract_idstringOptionnel

The contract ID associated with a specific contract/collection/customer (ex: the event ID or 'subscription')

Example: summer_party
Réponses
200

Returns a list with all the interactions

application/json
get
/getAllInteractions
get
/getAllInteractionScansForToken

Getting all the actions applied on a NFT

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Paramètres de requête
originstringRequis

The partner's name.

Example: spacex
tokenIdstringRequis

The token ID to fetch the interactions for

Example: 123
contractstringOptionnel

The contract for which to retrieve the interactions

Example: 0x0123456789abcdef0123456789abcdef01234567
contract_idstringOptionnel

The contract ID associated with a specific contract/collection/customer (ex: the event ID or 'subscription')

Example: summer_party
Réponses
200

Returns a list with all the interactions

application/json
get
/getAllInteractionScansForToken
get
/getBlockchainTxForToken

Getting all the blockchain transactions for a specific token, with the information related to the transaction.

Autorisations
AuthorizationstringRequis
Bearer authentication header of the form Bearer <token>.
Paramètres de requête
originstringRequis

The partner's name.

Example: spacex
contract_idstringRequis

The contract ID associated with a specific contract/collection/customer (ex: the event ID or 'subscription')

Example: summer_party
token_idstringRequis

The token ID for which to retrieve the blockchain transactions

Example: summer_party
Réponses
200

Returns a list with all the blockchain transactions

application/json
get
/getBlockchainTxForToken

Webhooks

It is also possible to set up webhooks to get notified about some specific events occuring in Gardenlab.

The failure object is sent only when there is no "hope" about succeeding in performing the blockchain transactions. Gardenlab system is designed to try multiple times to perform a transaction if no fatal error occurs on the transaction.

New interaction with blockchain update:

Type :

Success Content:

Failure Content:

New NFT minted

Type :

Header:

Success content:

Failure content:

Mis à jour