We use API tokens to manage authentication to our api. After creating a SKUSavvy account, simply go to the link below to create or manage your accounts tokens which you can use to make authenticated requests on behalf of your SKUSavvy account.
After you've created a token and stored it somewhere safe, simply pass it as a header like so:
"X-Token": "aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ=="
To make a GraphQL request, send a POST request to https://app.skusavvy.com/graphql with a request body containing the key/values of query, and optionally variables (if the operation contains $variableDefinitions)
// NodeJS example:
import fetch from 'node-fetch';
fetch("https://app.skusavvy.com/graphql", {
"headers": {
"accept": "application/json",
"content-type": "application/json",
"x-token": "j.w.t", // replace with your API Token
},
"body": JSON.stringify({ query: `
query Me {
me {
id
name
}
}`.trim(),
variables: {}
}),
"method": "POST"
}).then(res => res.json())
.then(console.log)
.catch(console.log);
The full documentation of our API is publicly accessible at:
https://app.skusavvy.com/graphiql