Invalid token_uri and metadeta null in "getAllTokenIds" Web3 API Call

For collection β€œ0x77640cf3f89a4f1b5ca3a1e5c87f3f5b12ebf87e”, this is the response:

Here: The token_uri given is https://aaa-microservice.herokuapp.com/token/3317 which is invalid.

The correct token_uri for token 3317 in the same collection is angryapes.mypinata.cloud/ipfs/QmPhREWNvNbKApuK577BpJRrjmEGYxsMkaWcgZiqtKaJ1Q/3317 which I got from Etherscan Read Contract URL.

I got the answer for why Metadeta might be null: https://docs.moralis.io/misc/faq#why-is-metadata-null-for-some-nfts but token_uri is also invalid so there is no way to get metadata now.

Any idea why is this happening?

it looks like now that is the uri associated with that token id, but I don’t know what the contract returned at the time when we got the token_uri, maybe the contracted updated the token_uri meanwhile

Ohh, okay
Is there any way around to fix this?

you can also get the token_uri if you want by using runContractFunction for example, before getting the metadata

Ohh, great. Can you please let me know an example for this? How can I exactly use the runContractFunction using Moralis for the above contract for example? @cryptokid

here is an example:

@cryptokid Thank you so much. :smiley: