### Uploading Tokens with CSV Format - NFT.Storage Source: https://app.nft.storage/v1/docs/intro Demonstrates the expected structure for a CSV file when uploading tokens to NFT.Storage. Each row should contain the tokenID and its corresponding content ID (cid). This format is used for batch uploads via the website dashboard. ```csv tokenID, cid 1, bafy... 2, bafz... 3, bafx... ``` -------------------------------- ### Uploading Tokens with JSON Format - NFT.Storage Source: https://app.nft.storage/v1/docs/intro Illustrates the required JSON structure for uploading tokens to NFT.Storage. The data should be an array of objects, where each object contains the 'cid' and 'tokenID' for a specific token. This format is used for batch uploads via the website dashboard. ```json [ {"cid":"content_id_1", "tokenID":"token_id_1"}, {"cid":"content_id_2", "tokenID":"token_id_2"}, {"cid":"content_id_3", "tokenID":"token_id_3"}, ... ] ``` -------------------------------- ### GET /api/v1/auth/list_api_keys Source: https://app.nft.storage/v1/docs/client/http-api Retrieves a list of all API keys associated with the user account. ```APIDOC ## GET /api/v1/auth/list_api_keys ### Description Retrieves a list of all API keys associated with the user account. ### Method GET ### Endpoint /api/v1/auth/list_api_keys ### Response #### Success Response (200) - **apiKeys** (array) - List of API keys with their details. #### Response Example ```json [ { "keyID": "b4afc16a-301a-4c45-b369-13053779889b", "name": "My First Key", "created_at": "2023-01-01T12:00:00Z" } ] ``` ``` -------------------------------- ### GET /api/v1/collection/list_collections Source: https://app.nft.storage/v1/docs/client/http-api Retrieves a list of all NFT collections associated with the API key. ```APIDOC ## GET /api/v1/collection/list_collections ### Description Retrieves a list of all NFT collections associated with the API key. ### Method GET ### Endpoint /api/v1/collection/list_collections ### Response #### Success Response (200) - **collections** (array) - List of collections with their details. #### Response Example ```json [ { "id": "collection_id_1", "name": "Collection Name 1", "created_at": "2023-01-01T12:00:00Z" }, { "id": "collection_id_2", "name": "Collection Name 2", "created_at": "2023-01-02T12:00:00Z" } ] ``` ``` -------------------------------- ### GET /api/v1/user/get_balance Source: https://app.nft.storage/v1/docs/client/http-api Retrieves the current balance of the user's account. ```APIDOC ## GET /api/v1/user/get_balance ### Description Retrieves the current balance of the user's account. ### Method GET ### Endpoint /api/v1/user/get_balance ### Response #### Success Response (200) - **balance** (number) - The user's current balance. #### Response Example ```json { "balance": 100.50 } ``` ``` -------------------------------- ### Check Deal Status API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This snippet demonstrates how to make a GET request to the NFT Storage API to check the deal status for a given CID. It requires the CID as a query parameter. The response indicates the deal status for the specified CID. ```shell curl --location 'https://preserve.nft.storage/api/v1/collection/deal_status?cid=YOUR_CID' ``` -------------------------------- ### GET /api/v1/collection/deal_status Source: https://app.nft.storage/v1/docs/client/http-api Retrieves the deal status for a specified CID (Content Identifier) of an NFT. ```APIDOC ## GET /api/v1/collection/deal_status ### Description Retrieves the deal status for a specified CID (Content Identifier) of an NFT. ### Method GET ### Endpoint /api/v1/collection/deal_status #### Query Parameters - **cid** (string) - Required - The CID (Content Identifier) of the token ### Request Example ```json { "example": "curl --location 'https://preserve.nft.storage/api/v1/collection/deal_status?cid=YOUR_CID'" } ``` ### Response #### Success Response (200) - **dealStatus** (object) - The status of the deal for the specified CID. #### Response Example ```json { "example": "{\"cid\": \"YOUR_CID\", \"dealId\": \"YOUR_DEAL_ID\", \"status\": \"ACTIVE\"}" } ``` ``` -------------------------------- ### GET /api/v1/collection/retry_tokens Source: https://app.nft.storage/v1/docs/client/http-api Initiates a retry for failed pinning of a specified token ID. ```APIDOC ## GET /api/v1/collection/retry_tokens ### Description Initiates a retry for failed pinning of a specified token ID. ### Method GET ### Endpoint /api/v1/collection/retry_tokens #### Query Parameters - **tokenID** (string) - Required - The CID of the failed token to retry pinning. #### Headers - **Authorization** (string) - Required - API Key for authentication (Bearer YOUR_API_KEY) ### Request Example ```json { "example": "curl --location 'https://preserve.nft.storage/api/v1/collection/retry_tokens?tokenID=CID' --header 'Authorization: Bearer YOUR_API_KEY'" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating retry initiation. #### Response Example ```json { "example": "{\"message\": \"Retry initiated for the specified token\"}" } ``` ``` -------------------------------- ### Get User Balance API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This snippet shows how to retrieve the user's balance using the NFT.Storage API. It requires the API key for authentication. ```curl curl --location 'https://preserve.nft.storage/api/v1/user/get_balance' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### GET /api/v1/collection/list_tokens Source: https://app.nft.storage/v1/docs/client/http-api Retrieves a list of tokens within a specific NFT collection. Supports pagination using `lastKey`. ```APIDOC ## GET /api/v1/collection/list_tokens ### Description Retrieves a list of tokens within a specific NFT collection. Supports pagination using `lastKey`. ### Method GET ### Endpoint /api/v1/collection/list_tokens ### Parameters #### Query Parameters - **collectionID** (string) - Required - ID of the collection. - **lastKey** (string) - Optional - ID of the last fetched token. Use `undefined` for the first page. ### Response #### Success Response (200) - **tokens** (array) - List of tokens of a collection (max 500 per request). #### Response Example ```json [ { "id": "token_id_1", "cid": "ipfs_cid_1", "created_at": "2023-01-01T12:00:00Z" }, { "id": "token_id_2", "cid": "ipfs_cid_2", "created_at": "2023-01-02T12:00:00Z" } ] ``` ``` -------------------------------- ### List Tokens in Collection API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This example demonstrates how to fetch a list of tokens within a specific collection using the NFT.Storage API. It requires the collection ID and optionally a `lastKey` for pagination. The API returns a maximum of 500 tokens per request. ```curl curl --location 'https://preserve.nft.storage/api/v1/collection/list_tokens?collectionID=YourCollectionID&lastKey=CollectionLastKey' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Delete API Key Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This example demonstrates how to delete a specific API key using its ID via the NFT.Storage API. The request requires the `keyID` as a query parameter and the API key for authentication. ```curl curl --location --request DELETE 'https://preserve.nft.storage/api/v1/auth/remove_api_key?keyID=b4afc16a-301a-4c45-b369-13053779889b' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Add Tokens to Collection API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This example shows how to add tokens to an existing collection via the NFT.Storage API. It requires the collection ID and a CSV file containing token details. The CSV structure varies by blockchain network (e.g., Solana, Sui, or other networks). ```curl curl --location 'https://preserve.nft.storage/api/v1/collection/add_tokens' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --form 'collectionID="COLLECTION_ID"' \ --form 'file=@"ABSOLUTE_FILE_PATH";type=application/json' ``` -------------------------------- ### POST /api/v1/collection/create_collection Source: https://app.nft.storage/v1/docs/client/http-api Creates a new NFT collection. Requires collection name, contract address (or equivalent), chain ID, and network. ```APIDOC ## POST /api/v1/collection/create_collection ### Description Creates a new NFT collection. Requires collection name, contract address (or equivalent), chain ID, and network. ### Method POST ### Endpoint /api/v1/collection/create_collection ### Parameters #### Request Body - **collectionName** (string) - Required - Name of the collection. - **contractAddress** (string) - Required - Address of the collection. Requirements vary by blockchain network (EVM: mandatory, Multiversx/Sui/Solana/Cardano: unique string if not provided, Counterparty: asset name, XRPL: issuer address, Xahau: hooks address). - **chainID** (string) - Required - Blockchain ID. - **network** (string) - Required - Blockchain network (e.g., Ethereum, Solana). ### Request Example ```json { "contractAddress": "CONTRACT_ADDRESS_OR_RESPECTIVE_STRING", "collectionName": "COLLECTION_NAME", "chainID": "CHAIN_ID", "network": "NETWORK" } ``` ### Response #### Success Response (200) - **message** (string) - 'Collection Created' #### Response Example ```json "Collection Created" ``` ``` -------------------------------- ### List API Keys Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This snippet shows how to retrieve a list of all API keys associated with the account using the NFT.Storage API. Authentication is done via the API key. ```curl curl --location 'https://preserve.nft.storage/api/v1/auth/list_api_keys' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### POST /api/v1/collection/add_tokens Source: https://app.nft.storage/v1/docs/client/http-api Adds tokens to an existing NFT collection. Tokens are provided via a CSV file, with specific formatting requirements based on the network. ```APIDOC ## POST /api/v1/collection/add_tokens ### Description Adds tokens to an existing NFT collection. Tokens are provided via a CSV file, with specific formatting requirements based on the network. ### Method POST ### Endpoint /api/v1/collection/add_tokens ### Parameters #### Request Body - **collectionID** (string) - Required - ID of the collection. - **tokens** (file) - Required - A CSV file containing the tokens to be added. CSV header and structure depend on the network: - **Solana**: `tokenAddress, cid` - **Sui**: `objectID, cid` - **Other Networks**: `tokenID, cid` ### Request Example ```json { "collectionID": "COLLECTION_ID" } ``` *(Note: The `tokens` parameter is a file upload, represented as `@"ABSOLUTE_FILE_PATH";type=application/json` in the curl example)* ### Response #### Success Response (200) - **message** (string) - 'Tokens added' #### Response Example ```json "Tokens added" ``` ``` -------------------------------- ### Create Collection API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This snippet demonstrates how to create a new collection using the NFT.Storage API. It requires the collection name, contract address (or a unique string for certain chains), chain ID, and network. The API key is used for authentication. ```curl curl --location 'https://preserve.nft.storage/api/v1/collection/create_collection' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --data '{ "contractAddress": "CONTRACT_ADDRESS_OR_RESPECTIVE_STRING", "collectionName": "COLLECTION_NAME", "chainID": "CHAIN_ID", "network": "NETWORK" }' ``` -------------------------------- ### List Collections API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This snippet illustrates how to retrieve a list of all collections associated with the API key using the NFT.Storage API. It requires only the API key for authentication. ```curl curl --location 'https://preserve.nft.storage/api/v1/collection/list_collections' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Retry Failed Pinning API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This snippet shows how to initiate a retry for a failed pinning job using the NFT Storage API. It requires the tokenID of the failed token as a query parameter and an API key for authentication. The API responds with a confirmation message indicating the retry has been initiated. ```shell curl --location 'https://preserve.nft.storage/api/v1/collection/retry_tokens?tokenID=CID' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### DELETE /api/v1/auth/remove_api_key Source: https://app.nft.storage/v1/docs/client/http-api Deletes a specific API key. Requires the `keyID` of the API key to be removed. ```APIDOC ## DELETE /api/v1/auth/remove_api_key ### Description Deletes a specific API key. Requires the `keyID` of the API key to be removed. ### Method DELETE ### Endpoint /api/v1/auth/remove_api_key ### Parameters #### Query Parameters - **keyID** (string) - Required - The ID of the API key to remove. ### Response #### Success Response (200) - **message** (string) - 'API key removed' #### Response Example ```json "API key removed" ``` ``` -------------------------------- ### DELETE /api/v1/collection/delete_tokens Source: https://app.nft.storage/v1/docs/client/http-api Deletes a failed pinning record for a specified token ID. ```APIDOC ## DELETE /api/v1/collection/delete_tokens ### Description Deletes a failed pinning record for a specified token ID. ### Method DELETE ### Endpoint /api/v1/collection/delete_tokens #### Query Parameters - **tokenID** (string) - Required - The ID of the failed token to delete. #### Headers - **Authorization** (string) - Required - API Key for authentication (Bearer YOUR_API_KEY) ### Request Example ```json { "example": "curl --location --request DELETE 'https://preserve.nft.storage/api/v1/collection/delete_tokens?tokenID=TOKEN_ID' --header 'Authorization: Bearer YOUR_API_KEY'" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful deletion. #### Response Example ```json { "example": "{\"message\": \"Failed token deleted successfully\"}" } ``` ``` -------------------------------- ### Delete Failed Pinning API Request (curl) Source: https://app.nft.storage/v1/docs/client/http-api This snippet demonstrates how to delete a failed pinning record using the NFT Storage API. It uses a DELETE request and requires the tokenID of the failed token as a query parameter, along with API key authentication. The API confirms the successful deletion of the failed token record. ```shell curl --location --request DELETE 'https://preserve.nft.storage/api/v1/collection/delete_tokens?tokenID=TOKEN_ID' \ --header 'Authorization: Bearer YOUR_API_KEY' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.