Get your Capture Token
Last updated
Last updated
To make the Numbers Protocol developer ecosystem more accessible, we've leveraged familiar concepts to create Capture SDK and Capture Token for API access. The Capture Token allows developers to perform tasks like updating asset history, tracing asset provenance, and generating AI images with blockchain validation. For experienced Web3 developers, our open-source tools like 'nit' continue to offer direct development via wallets or private keys.
In this tutorial we will help you begin your development journey by covering both tradition and Web3 methods of how to acquire a Capture Token. Let us begin!
Before we can acquire the Capture Token, we will need to create an account. This can be done easily through Capture Cam or through Capture Dashboard. If you wish to create an account via API, you will need to acquire an API key by contacting [email protected].
Download Capture for iOS or Android, click “Create an Account” and fill in fields to create an account
Navigate to Capture Dashboard click on “Create an account’ and fill in information to create an account
Now that we have our account all set up, let’s get our Capture Token!
Utilize POST https://api.numbersprotocol.io/api/v3/auth/token/login/ with email & password payload to login and acquire auth_token
.
Successful login event will output an auth_token response. This auth_token
can be passed in as Authorization Header for future Capture API functions.
By making a request to the endpoint below with a valid token included in the headers, the user is able to verify their token and access the resources or services that are protected by the token. This endpoint is useful for ensuring that a user is authorized to access certain content or perform certain actions on a website or application. Additionally, this endpoint could also be used to check the validity of a token during a user's session.
The following sample codes can be used to validate the Capture Token.
The response.data.results[0]
is the JSON object containing the user information. Following is an example of a JSON object returned by an API endpoint. The object contains information about a user, including their address, username, email, language, and wallet information.
An alternative approach to acquiring your Capture Token is through wallet login. While not as straightforward as previously outlined methods, this approach offers developers a more Web3 method of acquiring the Capture Token.
Wallet Login is done with your accounts Integrity Wallet which in the Numbers Protocol network is used for creating signatures. By combining your Integrity Wallet with client side code communicating with a wallet such as MetaMask and a few Capture API calls we can execute the wallet login.
Below is a code snippet for wallet login:
In this walkthrough, we covered how to create a Capture Account and most importantly how to acquire the Capture Token. We also demoed how to pass in the Capture Token as an Authorization Header to verify your Capture Account. For a developer, the Capture Token is a key starting point for your Numbers Protocol development journey. With it you can perform asset registration as well as create commits on Numbers Blockchain. We will have walkthroughs for each of these coming in the future so stay tuned.
If you had trouble acquiring your Capture Token feel free to drop a question in our community channels. We will do our best to resolve your issues as soon as possible!