Hello Scott/John,
showing log to provider, they realized they have given me wrong information as far as what parameters required to call oauth/token for authorizaion code based call vs refresh_token based call. Here are the parameters and now i am getting access/refresh token. But my rc value after http_Req call is 1, i was expecting 200. Also in the debug log "SetError() #13: HTTP/1.1 200 OK", what this mean?
PostString = '{ "grant_type": "authorization_code", ' +
'"client_id":' + #Qd + %Trim(UEPCID) + #Qd + ',' +
'"client_secret":' + #Qd + %Trim(UEPCSC) + #Qd + ',' +
'"code":' + #Qd + %Trim(#Aut_Code) + #Qd + ',' +
'"redirect_uri":' + #Qd + %Trim(urr) + #Qd + '}';
rc = http_req('POST': urt: *omit : result : *omit : postsstring);
If rc > 199 and rc < 300 ;
Exsr ReadRefTkn;
Else;
ExSr ReadTknError;
EndIf;
DebugLog:
senddoc(): entered
{ "grant_type": "authorization_code", "client_id":"aShxEuP...
recvresp(): entered
HTTP/1.1 200 OK
Date: Fri, 02 Aug 2024 16:42:35 GMT
SetError() #13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: chunked 0
header_load_cookies() entered
chunk size = 1017
get_chunk_size returned 1017
calling comm_blockread
{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCI
comm_blockread returned 1017
get_chunk_size(): entered
0
chunk size = 0
get_chunk_size returned 0
http_close(): entered
For my next step to make label API:
I have to call
https://api.testing.stampsendicia.com/sera/v1/labels, according to documentation, i got to pass following in header
Headers:
Authorization: Bearer [Your Access Token]
Content-Type: application/json
I am doing http_req but do not see how to pass 2 pieces of header information in to http_req?
Note: postdata has body detail jason
rc = http_req( 'POST': url: *omit : result : *omit : postdata);