You didn't mention if your IBM i is making a request TO a service, or
acting as the server.

But, with your authentication it most likely is using some form of OAuth so
you probably need to pass the authentication information back in an HTTP
header (if you're making the request to a service). Normally it's
something like this:

Authorization: Bearer 0b79bab50daca910b000d4f1a2b675d604257e42

I am not familiar with how to add HTTP headers with the application you're
using since I always use GETURI for my HTTP requests. But I'm sure you can
find that or someone else can help as well. I would just make sure you
study the docs and most have sections on authentication/authorization that
are fairly specific.

Dealing with quite a few services over the past few years most use OAuth or
some "version" of that.

Bradley V. Stone
MAILTOOL Benefit #12 <>: Both Text
and HTML email support

On Tue, Nov 14, 2017 at 7:03 AM, Deon Fourie <DFourie@xxxxxxxxxxxxxxxxx>

Hi, I need to initiate a REST service on a PC server, after a RPG job

There are a set of JSON requests available on the PC server.

I had a look on IBM developerworks that gives very good examples how to
initiate a REST service.

1)The first one is a Authentication call.

I managed to make the authentication call with the supplied login
credentials (I get a "SUCCESS" XML back)

Uri = <url with the user and password supplied>
Uri2= <url with the actual call ti initate the job on the PC>

tHandle_A = axiscTransportCreate(uri:AXISC_PROTOCOL_HTTP11);
if (tHandle_A = *NULL);
PRINT ('TransportCreate() failed');

propBuf = 'GET' + X'00';
axiscTransportSetProperty(tHandle_A: AXISC_PROPERTY_HTTP_METHOD:

2)I'm struggling to find a way to pass this Authentication handle/token
(tHandle_A) back to the next call that initiates the actual service.

In the next call, that will initiate the job on the PC server, I create
new Handle , with a new URL (Uri2) to pass the necessary info to be able to
make the call .

I tried to rather set the authentication properties on the second call by

rc =axiscTransportSetProperty(tHandle:AXISC_PROPERTY_HTTP_

That doesn't work.

What I need is something like this: rc =axiscTransportSetProperty(

Where I pass the original handle (tHandle_A) that I got when I
authenticated with the first call.

Or any other method to supply the authentication token with the next call.

Any advice would be appreciated.

Deon Fourie

This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.