I have a requirement to get data from a secure API. It requires a certificate in the DCM, which I have set up. Then I have to make 2 calls.
The first one is a POST and you use basic authentication to pass a UserID and password to get back a token in the response body. This is working with this code:
// Open persistent connection pComm
= http_persist_open(URL);
// Set credentials http_setauth(HTTP_AUTH_BASIC:
username: passwd);
// use the certificate in the DCM app_id
=
'ADP_APPLICATION'; rc
= https_init(app_id);
if rc
=
-1; http_comp(http_error()); https_cleanup();
return;
endif; response
= http_string('POST':
URL: postdata:
'application/json')
; I am able to extract the token from the Response variable. The problem is with the second call. That token is then used in the second request which makes a GET to return the data stream. However the second request uses authentication
type “Bearer” and I don’t know how to code for that with HTTPAPI. I can make it work in Postman by pasting the token into the header authorization variable with the word Bearer. I would appreciate any help you can give on how to pass a bearer token with HTTPAPI. Thanks! Les Turner Developer Information Technology ManhattanLife Insurance T: 713-821-6414 |
-- _______________________________________________ Ftpapi mailing list Ftpapi@xxxxxxxxxxxxxxxxxxxxxx http://scottklement.com/mailman/listinfo/ftpapi