Hello I’m using the code below from your documentation but I have this message error : => "{\"error\":\"INVALID_GRANT\",\"message\":\"The access token was revoked\"}"
However, I also used the code to have the access token but i don’t know where I should put it in the code for the Job creation. Can you help me? thanks !!
require "uri"
require "json"
require "net/http"
url = URI("https://api.sandbox.stuart.com/v2/jobs")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"job": {
"pickups": [
{
"address": "32 Coombe Ln, Raynes Park, London SW20 0LA",
"comment": "Ask Bobby",
"contact": {
"firstname": "Bobby",
"lastname": "Brown",
"phone": "+33610101010",
"email": "bobby.brown@pizzahut.com",
"company": "Pizza Hut"
},
"access_codes": [
{
"code": "your_access_code_1",
"type": "text",
"title": "access code title",
"instructions": "please put your instructions here"
}
]
}
],
"dropoffs": [
{
"package_type": "medium",
"package_description": "yellow package",
"client_reference": "[your_client_ref]",
"address": "23 Ethelbert Rd, London SW20 8QD",
"comment": "3nd floor on the right",
"end_customer_time_window_start": "2021-12-12T11:00:00.000+02:00",
"end_customer_time_window_end": "2021-12-12T13:00:00.000+02:00",
"contact": {
"firstname": "Julia",
"lastname": "Moore",
"phone": "+33712222222",
"email": "client3@email.com",
"company": "Sample Company Inc."
},
"access_codes": [
{
"code": "your_access_code_2",
"type": "text",
"title": "access code title",
"instructions": "please put your instructions here"
}
]
}
]
}
})
response = https.request(request)
puts response.read_body