400 bad request

Hi guys,

The call to getNFTsFromContract() is giving me a 400 error (please see screenshot.)

This actually happens for quite a few functions but not for getNFTs(); it works.

Please help!

Hi, can you give more details? Like what parameters are you using? Some code example, server address in a selectable format.

			getNFTsOfUser = async () => {
				const options = {
					chain: "eth",
					address: ethAddress,
					token_address: "0x4581649af66bccaee81eebae3ddc0511fe4c5312" //
				};
				await Moralis.Web3API.account.getNFTsForContract(options).then(value => {
				//await Moralis.Web3.getNFTs(options).then(value => {
					nfts = value;
					console.log(nfts);
				}, reason => {
					console.error(reason);
				});
			}

I get that error in my first message when the call to getNFTsForContract() tries to execute in the code above.

Other calls to Moralis.Web3API functions work well? Trying to figure out if is a general api problem or something in particular with this function.

I’m your print screen it looks like you get an error for a different api function.

If it is a general api problem sometimes it can be solved by accessing https://admin.moralis.io/web3Api in order to generate an api key in case that it was not already generated previously

That did the trick! Thank you. I hadn’t yet created/copied my API key.

One more thing, this NFT https://etherscan.io/token/0xda9f43015749056182352e9dc6d3ee0b6293d80a doesn’t show up in the results of getNFTs() or getNFTsForContract(). It also doesn’t show up in the results of getTokenBalances(). It’s an old NFT from 2018. Any idea how I can interact with this contract using Moralis?

You can post this question as a separate forum post, it may be an NFT that it doesn’t use any standard and that is why it may not be recognized. You can interact with a smart contract if you know its address and its ABI or its code.