Closed dsfnaw22jlg closed 1 day ago
Thank you for reaching out, and I'm sorry to hear you're encountering an issue with your API key.
The error message "API Key is malformed or failed to parse" typically occurs when an API key from https://app.nft.storage/login is used for our NFT.Storage Classic product, which includes the NFTUp feature (accessible via https://classic.nft.storage/).
Please note that API keys from https://app.nft.storage/login are only compatible with our new version of the product available at that same URL. They do not work with NFT.Storage Classic.
About the NFT.Storage Classic Transition: NFT.Storage Classic, our original service, will continue to support existing uploads but does not allow new uploads after June 30, 2024. To meet our community's evolving needs, we've launched a new flagship product at https://app.nft.storage/. This platform is where you can back up off-chain NFT data.
Steps to Resolve the Issue:
If you continue to experience issues or have further questions, feel free to reach out. We're here to help!
Best regards, Elizabeth
Subject: Issue with API Key: "ERROR_MALFORMED_TOKEN"
Hello,
I am experiencing an issue with the NFT.Storage service. When I try to upload images via the API, I receive the following error:
css
Error uploading C:\secretteset1\NFT_Series1_Ticket1.png: { ok: false, error: { code: 'ERROR_MALFORMED_TOKEN', message: 'API Key is malformed or failed to parse.' } } I am using the following API key: db9292f1.8e23b74622e9474b84d8050368968ac4. The key was generated via your interface, and based on the documentation, it has been entered correctly in the request.
For sending the request, I’m using the axios library in Node.js. Below is the code snippet for the request:
javascript Копировать код const axios = require('axios'); const fs = require('fs'); const FormData = require('form-data'); const path = require('path');
const uploadImageToNFTStorage = async (filePath) => { const apiKey = '***'; const url = 'https://api.nft.storage/upload';
}; I have verified the format of the key and how it is being passed in the headers, but the error persists. I also tried generating a new API key, but the problem remains.
Could you please assist in identifying the cause of this error? It seems there might be an issue with the key or how it is being processed by the system.
Thank you in advance for your help!