Please help with 'Invalid project id'

i added my id and made request: but response is invalid project id: why?

curl -X POST -H "Content-Type: application/json" --data
'{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' 
https://mainnet.infura.io/v3/eee6e4d410c247dea2a8f21c3f8817ae

my project has exactly this id! https://infura.io/dashboard/ethereum/eee6e4d410c247dea2a8f21c3f8817ae/settings

Hi @95pz_aru - welcome to the Infura community! When I try to replicate the error with your project id above, I get an error message that user project is inactive.

I would suggest creating a new project with a new project ID, and then following the curl example from our docs - try putting the URL just after curl.

Let us know if this helps!

1 Like

I’m having the exact same problem. I created a brand new project, and I get this:

curl https://mainnet.infura.io/v3/9a86d4e3c92e4aeda17beb2e9bd050d9 -X POST -H “Content-Type: application/json” -d ‘{“jsonrpc”:“2.0”,“method”:“eth_blockNumber”,“params”: ,“id”:1}’

invalid project id

Hi @tasd, and welcome to the Infura community!

I would triple check that the project ID you’ve included is correct. If you’re still getting the error, I would recommend creating a new project ID and starting from there, as the curl request is properly set up.

Hi Leiya, thanks for the quick response!
I did exactly that. I’ve created 3 different projects now, and very carefully copied/pasted/checked the ID. None of them have worked. Here is the latest one:

tas@ribeye:~$ curl https://mainnet.infura.io/v3/d2c7be9512d244a8908dce72a4a64f26 -X POST -H “Content-Type: application/json” -d ‘{“jsonrpc”:“2.0”,“method”:“eth_blockNumber”,“params”: ,“id”:1}’

invalid project id

I m having the same issue, an old project which I had created a few weeks ago, was working correctly. I deleted it though, I completely regret that :joy:

If it is of any help it is still working with the deleted project id!

I’m having the same issue and am using the copy button on the project settings page so there’s no way it’s being entered incorrectly. I tried this with multiple projects and networks with the same result.

$ curl https://ropsten.infura.io/v3/<project-id> -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}'
invalid project id

It’s working now, for me, with old and new project IDs. I guess they fixed it.

1 Like

I am running a ETH2 node and using infura. I started to receive a similar error (temporarily).
There are some other people having similar issues at that time.

time="2020-12-10 15:01:09" level= **error** msg="could not query header with height 11423531: 401 
Unauthorized: invalid project id
time="2020-12-10 15:01:22" level= **error** msg="401 Unauthorized: invalid project id
time="2020-12-10 15:10:56" level= **error** msg="could not query header with height 11423577: 401 
Unauthorized: invalid project id

But it seems like a temporary issue (it was running without any issue since 10 days)

Getting this error as well. Likewise it was a temporary issue. Not sure what it is about

Hi there. @can_bal99 @novo
It was caused by an incident on Infura https://status.infura.io/incidents/snd77v5drglg
It should be fixed now. Can you confirm?

For me it is still the same. I already created couple of projects and it is saying “Invalid it”.
And yes, I copied them correctly :slight_smile:

Hi @Stas_Y, can you send me a dm with your project ID and Secret, as well as the request you’re sending, and I will help troubleshoot from there.

Hi @Leiya_Kenney
I have the same issue. I’ve created several projects, however, I got the same error.

curl -X POST https://rinkeby.infura.io/v3/<PROJECT-ID>

Hi @amish, and welcome to the Infura community!

Have you tried running the curl command with a method appended, like the below:

curl https://rinkeby.infura.io/v3/<PROJECT_ID> \
-X POST \ 
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params": [],"id":1}'

In order to get information back from the request, we need to send over exactly what we’re trying to get from our request, in other words, the method we’re trying to use. The Ethereum API uses JSON, which is why we need to send over our requests in that format.

Thanks for your response.

When I use it, it shows:

404 page not found
curl: (6) Could not resolve host:  -X
curl: (6) Could not resolve host: POST
curl: (6) Could not resolve host:  -H
curl: (3) Port number ended with ' '
curl: (6) Could not resolve host:  -d
curl: (3) [globbing] nested brace in column 55

With this one

curl https://rinkeby.infura.io/v3/<PROJECT-ID> -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params": [],"id":1}

I got invalid project id too

and I cannot use it in my code. Because I am doing in this way:

const HDWalletProvider = require("truffle-hdwallet-provider");

const Web3 = require("web3");

const { interface, bytecode } = require("./compile");

const provider = new HDWalletProvider(

"mnemonic",

"https://rinkeby.infura.io/v3/<PROJECT-ID>"

);

const web3 = new Web3(provider);

Here I got invalid projet id

Also experiencing this issue too.
HTTPError: 401 Client Error: Unauthorized for url: https://rinkeby.infura.io/v3/

For a project id on a project I recently created

Hi @festusowumi, and welcome to the Infura community!
When you’re getting that error, do you have your project ID included at the end of that URL? That is necessary to send requests.

@amish
Have you tried setting up a new project and using a new Project ID? Sometimes that will help fix the issue.