There are three major methods for turning your digital media files into Captures, registering them as Web3 assets, and accessing the Capture ecosystem. These methods include:
Using the Capture Cam
Using the Capture Dashboard
Registering with the Capture API
This page will primarily focus on the third method, registration with the API.
Register Captures
Registering assets via API is a simple way to create Captures. You will need to acquire your Capture Token before uploading the file. If you do not already have a Capture Token yet, please follow the instruction provided to create one.
The API key is optional. If you possess an API key, it's advisable to include it in the header as it helps in recording the name of the service where the asset was registered.
The Capture API is a pay-as-you-go system, which means you only pay for the API calls you make. This is a cost-effective way to use the API and it allows you to control your expenses. Make sure to top up and ensure sufficient funds in your wallet in the form of Credits or NUM to cover the cost. Payment for services is processed using NUM; if you want to know how much it costs in USD, you can check CoinGecko or CoinMarketCap.
Register asset
POSThttps://api.numbersprotocol.io/api/v3/assets/
Cost: 0.1 NUM per API call + Gas (~0.004 NUM per transaction)
{"id":"bafybeie23hdjuurtc5n77vbhjx6mmrmjo3lyzmtks4eki5ibwpqjoeb3eq","asset_file_name":"demo.jpg","asset_file_mime_type":"image/jpeg","caption":"This is an example.",}
Please note that proof session is a required part of your metadata. The hash, mimeType, and timestamp fields may be left empty, as the Capture backend will automatically calculate these values for you, as shown in the example above.
However, the more information you provide, the more trustworthy your assets are, which also make them more "decentralized". The example of meta can be found here.
It's preferable to provide an image file when the asset file is not an image.
For more information on how this registration API works, please refer to the API documentation.
Adding Signatures
In the Capture system, users are able to sign metadata prior to uploading it, thus ensuring the metadata's integrity on the blockchain. signature is the result after signing the metadata with the private key.
To ensure the integrity of your data, it is recommended to sign both the media file and the metadata file before uploading. The signature can be included in the request by using the signature field. For example, if you use AndroidOpenSSL to create the signature, it can be attached using the following command:
While the use of signatures is not mandatory, it is highly recommended as it helps to improve the integrity of your data.
You may also submit the signed_metadata in the API call so that the verification can proceed in the future. For example, if signed_metadata is submitted, the public key (address) can be verified by recovering signed_metadata with the signature provided.
Additional information in Capture is important because it helps to build trust and transparency in the digital media assets that are created and stored on the decentralized web. Having detailed information about an asset, such as its creation date, location, and owner, is crucial for establishing its authenticity and provenance. More verifiable information, more provenance of your Captures.
Adding information to a Capture is straightforward, one just needs to extend the information blocks during the asset registration. Information blocks can be defined as follows:
The provider field refers to the source of the information block, while the name field represents the name of the information block. The value to be registered should be placed in the value field. This allows for clear and organized storage of information about the Capture.
The following shows some pre-defined information blocks:
Import Assets
The importing API endpoint is used for importing NFTs.
{"id":"bafybeie23hdjuurtc5n77vbhjx6mmrmjo3lyzmtks4eki5ibwpqjoeb3eq","asset_file_name":"imported.jpg","asset_file_mime_type":"image/jpeg","caption":"This is an example.","nft_token_id":"1","nft_chain_id":1,"nft_contract_address":"0xfDD0642479Bb1E219945E7a44B882AfaB8BaF68B"}
{"id":"bafybeiagc3fjrdrrookzkbrtdnfuulpfmeqej3bqc6wpmuttsclykuidt4","asset_file_name":"imported.mp4","asset_file_mime_type":"video/mp4","image_file_mime_type":"image/jpeg","caption":"This is an example.","nft_token_id":"2","nft_chain_id":1,"nft_contract_address":"0xfDD0642479Bb1E219945E7a44B882AfaB8BaF68B"}
If the NFT owner is not the user's asset wallet, the signed_metadata and signature are also necessary. These will be used to validate the address that signed the signed_metadata as the NFT owner.
It is recommended to provide an image_file when the NFT's image is not in image file format.
[ {"id":"bafybeie23hdjuurtc5n77vbhjx6mmrmjo3lyzmtks4eki5ibwpqjoeb3eq","asset_file_name":"demo.jpg","asset_file_mime_type":"image/jpeg","caption":"This is an example." }]
{"id":"bafybeie23hdjuurtc5n77vbhjx6mmrmjo3lyzmtks4eki5ibwpqjoeb3eq","asset_file_name":"demo.jpg","asset_file_mime_type":"image/jpeg","caption":"This is an example."}
JSON string containing a list of signatures which were used to sign the data or metadata.
asset_file*
Object
The file object to be registered. Its size should not exceed 250 MB.
meta
String
JSON string containing proof and information to be registered.
image_file
Object
The image file. Its size should not exceed 100 MB.
signed_metadata
String
The signed metadata which could be verified with signature.
public_access
String
When registering asset, add and pin the file on the Numbers IPFS gateway. Default: true
nit_commit_custom
Object
Set Asset Tree values.
For a field defined in Asset Tree schema, its value will override the existing value; for a field not defined in Asset Tree schema, it will be added in the Asset Tree as a custom field.
InfoSnapshot
creationGPSAddress
No. 299, Section 4, Bade Road, Songshan District Taipei City