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

[Ftpapi] I'm obviously missing something ...



Cross-posted to HTTPAPI and WEB400

I just coded up a basic Zoom API request - this is the basic HTTPAPI code:

       url = 'https://api.zoom.us/v2/webinars/' +
             %EditC(webinarId: 'X') +
             '/tracking_sources';

       headerVars.contentType   = 'application/json';

       headerVars.authorization = 'Bearer mySecrtetCodeGoesHere';

       http_xproc( HTTP_POINT_ADDL_HEADER
                 : %paddr(addSpecialHeaders)
                 : %addr(headerVars) );

       rc = http_get( url: '/tmp/result.txt' );
       if rc <> 1;
          http_crash();
       endif;


       Dcl-Proc addSpecialHeaders;
       Dcl-Pi *N;
         headersToAdd    Varchar(32767);
         vars            likeds(headerVars) const;
       End-Pi;

       Dcl-C CRLF x'0d25';

       headersToAdd = 'content-type: ' + vars.contentType + CRLF
                    + 'authorization: ' + vars.authorization + CRLF;
       End-Proc;


This gives me a "401 - This page requires a user-id & password" error

If I copy/paste the credentials and URL into Insomnia and test it - it works.  The user Id stuff is in the "secret key" bit.

Since I copied and pasted this stuff into insomnia from the RPG stuff I can only assume I missed a step somewhere. But where?


Jon Paris
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi