Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Key Error: Malformed Token Issue with curl and nft.storage Library #2766

Open
aiwass66680 opened this issue Oct 26, 2024 · 3 comments
Open

Comments

@aiwass66680
Copy link

Hello NFT.Storage Support Team,

I’m experiencing a persistent issue with my API key when trying to upload files to NFT.Storage. Despite generating multiple new API keys, each attempt returns the following error message:

{"ok": false, "error": {"code": "ERROR_MALFORMED_TOKEN", "message": "API Key is malformed or failed to parse."}}

Here are the details of my setup and the troubleshooting steps I have already tried:

Testing with cURL Command: I attempted a direct upload using curl with the command:

curl -X POST https://api.nft.storage/upload -H "Authorization: Bearer <API_KEY>" -H "Content-Type: multipart/form-data" -F file=@"/path/to/file.png"

Each time, this resulted in the "API Key is malformed or failed to parse" error.

Generating Multiple API Keys: I generated several new API keys on the NFT.Storage dashboard and used them in both curl commands and scripts, but each key returned the same error.

Using nft.storage Node Library: I also tried using the nft.storage Node.js client library with the latest package version, following the setup and authentication instructions closely. This approach also returned errors related to authentication and retries.

Testing Network and Key Format: I confirmed network access to the API endpoint and verified the API key formatting to rule out any local issues. The problem persisted across these tests.

Could you please investigate this issue? I’d appreciate any guidance or support to resolve this, as I need to upload several files as part of my project.

Thank you for your assistance.

Best regards,
Davide Pasti

@NFTStorageGithub
Copy link
Collaborator

We wanted to update you on the latest information regarding NFT.Storage Classic, including NFTUp, and your data. As of 30 June 2024, no new uploads are being accepted to the Classic product (including NFTUp).

"API Key is malformed or failed to parse" is because
an API key from https://app.nft.storage/login
Is being used for
https://classic.nft.storage/ (the API, SDK or NFTUp).
API keys from https://app.nft.storage/login only work with https://app.nft.storage/login.

If you've purchased storage, it can be used to store data in the same login where you purchased it—app.nft.storage.
First mint your NFTs then send us the NFT data—metadata and imagery CIDs, blockchain(s) minted on, contract address and token IDs. We store these in long term Filecoin storage. Note that you need to upload the data to IPFS separately, here's a blog on how to do that: https://nft.storage/blog/onboard-nft-data-to-ipfs

@bicced
Copy link

bicced commented Nov 18, 2024

My api key generated in https://app.nft.storage/ does not work with the rest api documentation that is linked inside that app? https://app.nft.storage/v1/docs/client/http-api

Is there a discord or telegram support channel?

@elizabeth-griffiths
Copy link
Member

elizabeth-griffiths commented Nov 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@bicced @elizabeth-griffiths @NFTStorageGithub @aiwass66680 and others