Access token issues

Hello @willguill,

I just replied to your former post.
I recommend that you read my reply and use our client library instead of your own implementation. This will allow you among other things to use your token more easily.

Now to answer this post, your access token should be included in your headers for all the requests you send to the Stuart API. It must be provided under the Authorization field.

In your example, it would look like this:

url = URI("https://api.sandbox.stuart.com/v2/jobs")
access_token = "YOUR ACCESS TOKEN" # New line

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer #{access_token}" # New line

# Rest of your code

You can find information about our OAuth Authentication best practices here.

Cheers