[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Curl vs LIBHTTP



Well so far I can get it to work with curl in QSH and with Postman, but not with HTTPAPI, attached is the script.

 

Scott if you’d like the actual access token let me know I don’t feel comfortable sending it to a mailing list.

 

I figured out also that I really didn’t need all those additional headers it was just overkill as you pointed out.

 

Any advice you can offer would help.

 

First screen capture is when I run HTTPAPI that isn’t working:

 

 

 

Postman worked out:

 

curl via QSH worked as well:

 

 

RDi Screenshot:

 

 

Thank You,
John Place

284 Fuel Supply LLC
General Manager
Direct Line: 563-468-5289
Cell: 563-529-0162
Email: John.Place@xxxxxxxxxxxxxxx
            
Notice:  Any agreement discussed or implied in this message is for discussion purposes only and may not be relied upon to bind the company.  Agreements are binding only when fully committed to writing and executed by authorized representatives of all the parties.  The information contained herein, while provided in good faith and believed to be accurate, is provided by 284 Fuel Supply, LLC and or Iowa 80 Group, Inc. and their affiliates as an accommodation to their readers for information purposes only, it is not guaranteed as to accuracy or completeness.  The information contained in this communication is confidential and is intended only for the use of the addressee. It is solely the property of 284 Fuel Supply and or Iowa 80 Group Inc. and their affiliates. Unauthorized use of this information, in whole or in part, is strictly prohibited. If you have received this communication in error, please notify us immediately by return e-mail and destroy this communication, including all attachments and any copies.

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Scott Klement
Sent: Friday, October 2, 2020 12:47
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Ftpapi] Curl vs LIBHTTP

 

Hi John,

Did you download and install HTTPAPI?  Is it up-to-date?

-SK

On 10/2/2020 8:29 AM, John Place wrote:

Thanks Scott, the only problem I’m having is http_string doesn’t seem to be defined anywhere, perhaps I’m missing something?

 

 

Thank You,
John Place

 

**FREE

//=================================================================================================
// Copybooks -
//=================================================================================================

/Copy QCPYSRC,FMC00CB001
/Copy QRPGLESRC,HTTPAPI_H

//=================================================================================================
// Main(); Main Program
//=================================================================================================

DCL-PROC Main;

  DCL-S Data   VarChar(1000);
  DCL-S Result VarChar(1000);

  Data = '{"params":["DAY = ''2020-09-28''"],"report_type":"app","app_id":64}';

  HTTP_XProc( HTTP_POINT_ADDL_HEADER: %paddr(AddHeaders) );

  HTTP_SetAuth( HTTP_AUTH_NONE: '': '');

  Monitor;
    Result = HTTP_String( 'GET'
             :'https://api.peachworks.com/v1/accounts/5105/reports/47/run'
             : Data
             :'application/json');
  On-Error;
    ErrorMsg = HTTP_Error();
  EndMon;

END-PROC Main;

//=================================================================================================
// Add Headers(); Add Additional Headers
//=================================================================================================

DCL-PROC AddHeaders;

  DCL-PI *N;
    Token VarChar(81);
  END-PI;

  Token = 'Authorization: ';

END-PROC;

//=================================================================================================
// End of Program
//=================================================================================================
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi