[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unable to get a successful HTTPAPI response
Hi,
We've made some headway. We added my group profile to all the
directories and the KDB file with full access. I believe the
authorities have been set correctly now.
What we are getting now is a HTTP 400 (Bad data) error. Pasted below is
the debug log and a code snippet. I have removed the certificate for
easier reading.
The following text needs to be part of the raw Body and this is where I
feel I am doing the mistake.
{
� � "grant_type":"client_credentials"
}
I have it in my code as follows-
�************Beginning of CODE************** � � � � � � � � � � � � � � � � � � � �� // Set Authorization � � � � � � � � � � � � � � � � � � http_setauth(HTTP_AUTH_BASIC : dsAuthUsr : dsAuthPwd); � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� data = '{"grant_type":"client_credentials"}'; � � � �� size = %len(%trim(data)); � � � � � � � � � � � � � � �� rc = http_url_post_raw(dsAuthUrl : %addr(data) : size :� � � � � � � � � � � � �1 : %paddr('PARSEINCOMING')); � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� // Parse the Header Data � � � � � � � � � � � � � � � � http_xproc(HTTP_POINT_PARSE_HEADER : %paddr('READHDR'));
�************Ending of CODE************** � � � � � � � � � � � � � � � � � � � �� NOTE: The Host and Authorization from the log below are correct as
compared with the Postman application
Debug Log-
�************Beginning of data************** � � � � � � � � � � � � � � � � � � � �� HTTPAPI Ver 1.17 released 2006-09-23 � � � � � � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
� � � � � � � http_setauth(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � http_persist_open(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � �� http_long_ParseURL(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � � https_init(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � -----------------------------------------------------------------------
--------------
Dump of local-side certificate information: � � � � � � � � � � � � � � � � � � � � � -----------------------------------------------------------------------
--------------
-----------------------------------------------------------------------
--------------
Dump of server-side certificate information: � � � � � � � � � � � � � � � � � � � �� -----------------------------------------------------------------------
--------------
Cert Validation Code = 6000 � � � � � � � � � � � � � � � � � � � � � � � � � � � � � -----BEGIN CERTIFICATE----- � � � � � � � � � � � � � � � � � � � � � � � � � � � � � MIIFQDCCBCigAwIBAgIIGMlF8bmCI9kwDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV � � � � � � � � � �� udCsbg== � � � � � � � � � � � � � � � � � � � � � � � � � � � � -----END CERTIFICATE----- � � � � � � � � � � � � � � � � � � �� Serial Number: 18:C9:45:F1:B9:82:23:D9 � � � � � � � � � � � � � Common Name: *.[1]api.manheim.com � � � � � � � � � � � � � � � � � Org: Domain Control Validated � � � � � � � � � � � � � � � � �� Issuer CN: Go Daddy Secure Certificate Authority - G2 � � � � �� Issuer Country: US � � � � � � � � � � � � � � � � � � � � � � � Issuer State/Province: Arizona � � � � � � � � � � � � � � � � � Issuer Locality: Scottsdale � � � � � � � � � � � � � � � � � �� Issuer Org: GoDaddy.com, Inc. � � � � � � � � � � � � � � � � �� Issuer Org Unit: [2]http://certs.godaddy.com/repository/ � � � � �� Unknown Field: 3 � � � � � � � � � � � � � � � � � � � � � � � � � �� Unknown Field: 20150723153240 � � � � � � � � � � � � � � � � � � � � Unknown Field: 15:32:40 23-07-2015 � � � � � � � � � � � � � � � � �� Unknown Field: 20170723153240 � � � � � � � � � � � � � � � � � � � � Unknown Field: 15:32:40 23-07-2017 � � � � � � � � � � � � � � � � �� Unknown Field: 1.2.840.113549.1.1.11 � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � Protocol Used: TLS Version 1 � � � � � � � � � � � � � � � � � � � �� http_persist_post(): entered � � � � � � � � � � � � � � � � � � � �� http_long_ParseURL(): entered � � � � � � � � � � � � � � � � � � � � do_post(): entered � � � � � � � � � � � � � � � � � � � � � � � � �� POST /oauth2/token � � � � � � � � � � � � � � � � � � � � � � � � �� Host: [3]integration1.api.manheim.com � � � � � � � � � � � � � � � � �� User-Agent: http-api/1.17 � � � � � � � � � � � � � � � � � � � � � � Content-Type: text/xml � � � � � � � � � � � � � � � � � � � � � � �� Expect: 100-continue � � � � � � � � � � � � � � � � � � � � � � � �� Content-Length: 0 � � � � � � � � � � � � � � � � � � � � � � � � � � Authorization: Basic c2h2bWFoNXB1dTZ5OGsydGFkNTZ3eWdlOjN3Q0NjZ3VyRzg=
� � � � � � � � � � � � � � � � � � � �� recvresp(): entered � � � � � � � � � �� HTTP/1.1 400 BAD_REQUEST � � � � � � � � Content-Length: 0 � � � � � � � � � � �� Connection: Close � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � �� SetError() #13: HTTP/1.1 400 BAD_REQUEST
recvdoc parms: identity 0 � � � � � � �� header_load_cookies() entered � � � � �� recvdoc(): entered � � � � � � � � � � � SetError() #0: � � � � � � � � � � � � � SetError() #13: HTTP/1.1 400 BAD_REQUEST
http_close(): entered � � � � � � � � �� �************End of Data********************
On Tue, May 3, 2016 at 2:21 PM, Shubhadeep Roy
<[4]shubhadeep.roy@xxxxxxxxx> wrote:
Hi,
I am trying to connect to a TIBCO Mashery endpoint to get an Auth Token
with a user name and password provided to me.� �e same request works when I am use Postman application to get the
Auth Token with the same credentials. The Auth Token comes in the
Header of the Post request.
I am pasting below the code and httpdebug log.� am not sure if I am
populating the variable "data" correctly. In Postman, this text is sent
in the Body as can be seen in the embedded image.
�nline image 1 � �de-
P getExtColor � � B � � � � � � � � � Export � � � D getExtColor � � PI � � � � � �30A � � � � � � �� D �ppUserID � � � � � � � � � � 24A � Value � � �� D �ppPwd � � � � � � � � � � � �10A � Value � � �� D �ppAuthToken � � � � � � � � �24A � Value � � �� D �ppVin � � � � � � � � � � � �17A � Value � � �� D �ppAuthUrl � � � � � � � � �1024A � Value � � �� D �ppDescUrl � � � � � � � � �1024A � Value � � �� /Free � � � � � � � � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � �http_debug(*ON : '/tmp/ShubhDebugLog.txt'); � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � �// Set Authorization � � � � � � � � � � � � � � � � �� � �http_setauth(HTTP_AUTH_BASIC : ppUserID : ppPwd); � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � �data = '{"grant_type":"client_credentials"}'; � � � � � � �size = %len(%trim(data)); � � � � � � � � � � � � � � � � �rc = http_url_post_raw(ppAuthUrl : %addr(data) : size :
� � � � � � � � � � � � � 1 : %paddr('PARSEINCOMING'));
�� � �http_xproc(HTTP_POINT_PARSE_HEADER : %paddr('READHDR')); � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � �If rc <> 1; � � � � � � � � � � � � � � � � � � � � � � � � �msg = http_error; � � � � � � � � � � � � � � � � � � � �Else; � � � � � � � � � � � � � � � � � � � � � � � � � � � �...
� �EndIf;
� �Return extColor; � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � /End-Free � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � P getExtColor � � E � P readHdr � � � � B � � � � � � � � � � � � D readHdr � � � � PI � � � � � � � � � � �� D �headerData � � � � � � � � 2048A � const
�* � � � � � � � � � � � � � � � � � � � �� D hdrData � � � � � � � � � � 2048A � � � � �/Free � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � hdrData = headerData; � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �/End-Free � � � � � � � � � � � � � � � �� P readHdr � � � � E � � � � � � � � � � � � Debug Log
�************Beginning of data************** � � � � � � � � � � � � � � � � � � � � � � � � � � � � � HTTPAPI Ver 1.17 released 2006-09-23 � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
� � � � � � � � � � � � � � �� http_setauth(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� http_persist_open(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � http_long_ParseURL(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� https_init(): entered � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� (GSKit) Access to the key database is not allowed. � � � � � � � � � � � � � � � � � � � � � � � � � � ssl_error(6003): (GSKit) Access to the key database is not allowed. � � � � � � � � � � � � � � � � �� SetError() #24: gsk_env_init: (GSKit) Access to the key database is not
allowed. � � � � � � � � � � � -----------------------------------------------------------------------
-------------- � � � � � � � �� Dump of local-side certificate information: � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� -----------------------------------------------------------------------
-------------- � � � � � � � �� (GSKit) An operation which is not valid for the current SSL session
state was attempted. � � � � � � � ssl_error(5): (GSKit) An operation which is not valid for the current
SSL session state was attempted.
(GSKit) An operation which is not valid for the current SSL session
state was attempted. � � � � � � � �************End of Data******************** � � � � � � � � � � � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � � �� --
Warm regards,
Shubh
All is well. Everything will be OK!!! - Shubh
--
Warm regards,
Shubh
All is well. Everything will be OK!!! - Shubh
References
1. http://api.manheim.com/
2. http://certs.godaddy.com/repository/
3. http://integration1.api.manheim.com/
4. mailto:shubhadeep.roy@xxxxxxxxx
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------