Do you have a cURL example for a query?

Modified on Fri, 29 Jul 2022 at 05:37 PM

Here is an supply example for searching for a part 500R14N220JV4T.

curl 'https://api.nexar.com/graphql' -H 'Accept-Encoding: gzip, deflate' -H 'Content-Type: application/json' \
-H 'Accept:application/json' -H 'Connection:keep-alive' -H 'Authorization: Bearer YOUR_TOKEN' \
--data-binary '{"query":"query q2 { supSearch(q: \"500R14N220JV4T\", limit: 3) { results { part { mpn manufacturer { name } } } } }"}' \
--compressed

The syntax can differ depending on the environment you are executing the cURL command in. For instance, the search query string needs to be surrounded by escaped quotes \" here.

If you're using bash or a similar shell, you can also set your access token as an environment variable, e.g. TOKEN, and use the following -H "Authorization: Bearer ${TOKEN}" noting the double quotes for this header.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article