VSELF API for collections

Status: in development

Getting started

VSELF API provides all the functionality of the NFT collection toolkit for NEAR-compatible version. It consists of RESTful view requests, which retrieve information from the NEAR contract, and call requests, which can make some changes or mint tokens.

Most call requests are used for collection management. These requests are almost always available for the collection owner only. The only call request available for everyone is the claim reward request. All other call requests will fail in case of a non-owner call. The view requests are available to call for everyone. The view requests are free, the call requests are paid. Learn more about payment management here.

API requests are done over HTTPS. The input and output formats for most API requests are JSON. The API is hosted here. All the requests require the developer API key as one of the parameters, which is managed using Pagoda Console. The requests with invalid API key will fail. There is a limitation for non-view requests the same user is able to make per minute.

In the next step, we will implement VSELF DID as a developer API key and sign all requests using the JWS scheme.

Error codes

10 - no response

30 - wrong input

31 - invalid NEAR ID

32 - collection is not found

33 - reward isn't found

60 - collection is unavailable

61 - collection wasn't started

62 - collection was expired

63 - reward was claimed

70 - insufficient funds of deposit

80 - no access rights

Endpoints

  • Start collection: saves collection data Input: name, description, start date, end date, list of rewards, collection settings Each reward consists of: name, description, link to the source image, reward code, list of hashtags Collection settings consists of the following settings: sign in requirement, reward transfer-ability, reward limitation, collection business status, collection publicity Output: collection id Catch: 30, 70

  • Stop collection: stops collection immediately Input: collection id Output: - Catch: 30, 32, 60, 61, 62, 70, 80 Modify collection date: modify the time period of the collection availability Input: collection id, new start date, new end date Output: - Catch: 30, 32, 60, 70, 80

  • Add collection rewards: adds new reward to the existing collection Input: collection id, list of new rewards Each reward consists of: name, description, link to the source image, reward code, list of hashtags Output: - Catch: 30, 32, 60, 62, 70, 80

  • Remove collection rewards: removes chosen rewards from the existing collection Input: collection id, list of new rewards Each reward consists of: name, description, link to the source image, reward code, list of hashtags Output: - Catch: 30, 32, 60, 62, 70, 80

  • Modify collection settings: manages collection settings, new settings won't be implemented for the achieved rewards Input: collection id, new settings Output: - Catch: 30, 32, 60, 62, 70, 80

  • Claim reward: mints reward for user Input: NEAR id, collection id, reward code Output: reward Catch: 30, 31, 32, 33, 60, 61, 62, 63, 70, 80

  • Send reward: mints reward for all users from list or community Input: list of the NEAR ids (community id), reward code Output: 30, 31, 32, 33, 60, 61, 62, 63, 70, 80

  • Set up achievement: add private reward and set up requirements for achieving it Input: activity config (learn more here), reward Output: 30, 32, 60, 62, 70, 80

  • Ongoing collections (View): returns list of available collections Input: - Output: list of collection ids Catch: -

  • Collection data (View): returns full information about the collection Input: collection id Output: collection Catch: 30, 32

  • Collection reward data (View): returns full information about the reward Input: collection id, reward code Output: reward Catch: 30, 32, 33

  • Owner collections (View): returns all collections created by chosen user Input: NEAR id Output: list of collection ids Catch: 30, 31

  • Collection owner (View): returns owner of the chosen collection Input: collection id Output: NEAR id Catch: 30, 32

  • Collection general stats (View): returns all the claim logs from collection Input: collection id Output: list of check ins Each check in consists of: NEAR id, reward code, timestamp (UTC) Catch: 30, 32

  • Collection participants (View): returns all the unique users claimed rewards Input: collection id Output: list of NEAR ids Catch: 30, 32

  • Collection activity logs (View): returns activity of user Input: collection id, NEAR id Output: activity config Catch: 30, 31, 32

  • Collection active users (View): returns users with activity satisfies activity config Input: activity config, collection id Output: list of NEAR ids Catch: 30, 32

Last updated