This is the CURL I need to post in order to get an authorization token
This is the code I've put together (which seems to be promising to me)curl -X 'POST' \
'https://XXXXXXX.com/api/v2/auth/login' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"login": "YYYYYYYYY",
password": "ZZZZZZZZ"
}'
Code: Select all
on mouseUp
local tHeaders, tResult, tBytes, tRecvHeaders, tPostData, tData
local tSettings
put "accept: application/json" & cr into tHeader
put "Content-Type: application/json" & cr after tHeader
put "" into tPostData
put "https://XXXXXXX.com/api/v2/auth/login" into tURL --the url
put "YYYYYYYYY" into tSettings["username"]
put "ZZZZZZZZ" into tSettings["password"]
put tsNetPostSync(tURL, tHeaders, tPostData, tRecvHeaders, tResult, tBytes, tSettings) into tData
put tData
end mouseUp
Many thanks{"type":"error","message":"1 validation error for Request\nbody\n field required (type=value_error.missing)","status":422}