Skip to main content

When I tried to search with Censys Platform API, I encountered 403 error.

Search / Query

 

Request:

curl --request POST \
     --url 'https://api.platform.censys.io/v3/global/search/query?org=zzzz \
     --header 'accept: application/vnd.censys.api.v3.search.v1+json' \
     --header 'authorization: Bearer censys_xxxxxxxxx_xxxxxxxxxxxxxxxxx' \
     --header 'content-type: application/json' \
     --data '{"query":"8.8.8.8"}'

 

Response:

{
  "title": "Forbidden",
  "status": 403,
  "detail": "Forbidden"
}

Hey there! Are you using the correct orgID? Try using the orgID that is appended to Platform URLs when you are logged in to the web interface. Let me know if that works. Thanks!


Thank you for your comment!

I used my actual org id but it returns the same error.

 

curl --request POST \
     --url https://api.platform.censys.io/v3/global/search/query \
     --header 'X-Organization-ID: zzzzz' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer censys_xxxxxxxxx_xxxxxxxxxxxxxxxxx' \
     --header 'content-type: application/json' \
     --data '{"query":"8.8.8.8"}'


Hi again, sorry for the hold-up on this. Does your user have the API Access role?

You can check this within the Platform UI under Settings > Account Management > Organization Settings > Members.

If your user has the API Access role, you will see it in the entry for your user, as shown in the image below.

If you do not see the API Access role, click the three-dot icon on the user’s row. Click the pencil icon, and then on the Edit Member page check the API Access role and click Update.


I have not enabled API access and finally I can execute API!

Thank you for your kind support!


Glad to hear it. Thanks for your patience. We will add that information to our documentation shortly.


Reply