×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




How do you tell what port you're using in HTTPAPI?

On Thu, Sep 18, 2025 at 2:36 PM Greg Wilburn <
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

So I am still struggling here... I am able to connect to this API and
receive an Access Token using Postman. However, I cannot seem to connect
successfully from a simple RPG pgm using HTTPAPI (something I use all the
time).

I've even compared the HTTP request in Postman to the HTTPAPI debug file.
I even compared the Base64 encoded "Authorization" in Notepad++.

Differences:
1. Postman has a "cookie"
2. Headers are in a different order

Any ideas? I'm at a complete loss.

Postman HTTP (successful):
POST /v3/token HTTP/1.1
Host: marketplace.walmartapis.com
WM_SVC.NAME: Walmart Marketplace
Accept: application/json
User-Agent: http-api/1.43
Content-Type: application/x-www-form-urlencoded
Authorization: Basic YTJlZTE.....
Cookie: ak_bmsc=.......p4aGV/sU=~1
Content-Length: 29

grant_type=client_credentials


HTTPAPI (unsuccessful):
POST /v3/token HTTP/1.1
Host: marketplace.walmartapis.com
User-Agent: http-api/1.43
Content-Type: application/x-www-form-urlencoded
Content-Length: 29
Authorization: Basic YTJlZTE...
WM_SVC.NAME: Walmart Marketplace
Accept: application/json

senddoc(): entered
grant_type=client_credentials
recvresp(): entered
SetError() #44: CommTCP_read: Socket has been shut down.
recvresp(): end with err
http_close(): entered




-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Greg
Wilburn
Sent: Tuesday, September 16, 2025 8:31 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Walmart Marketplace API

Sure...

The clientId and clientSecret are set above this code. I am trying to get
an Access Token.


rc = http_setauth(HTTP_AUTH_BASIC :clientID :clientSecret);

// Get an Access Token
http_debug(*on :FLDR + '/' + inCom + '/http_debug.txt');

URL = 'https://marketplace.walmartapis.com/v3/token';
method = 'POST';
form = WebForm_open();
WebForm_setVar(form :'grant_type' :'client_credentials');
body = WebForm_getData(form);
WebForm_close(form);

Response = FLDR + '/' + inCom + '/token_response.json';

Exec Sql set :uuid = generate_uuid();
Ifs_WriteToFile(logFd:'UUID: ' + uuId);
headerVars.partnerId = '10001667921';
headerVars.uniqueId = uuId;
headerVars.serviceName = 'Walmart Marketplace';
headerVars.acceptType = 'application/json';

rc = http_xproc( HTTP_POINT_ADDL_HEADER
: %paddr(addHttpHeaders)
: %addr(headerVars));

rc = http_req( method
: URL
: response
: *omit
: *omit
: body
: 'application/x-www-form-urlencoded');



-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jon
Paris
Sent: Monday, September 15, 2025 6:43 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <
rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Walmart Marketplace API

Wanna share a code snippet so we can see what you are requesting. I
played with this API a while back and had no issues. Nothing special that
I can recall.


Jon Paris
Jon.Paris@xxxxxxxxxxxxxx



On Sep 15, 2025, at 5:02 PM, Greg Wilburn <
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

Just wondering if anyone has implemented this?

Having issues just getting a token using HTTPAPI... the debug log shows
an "unknown protocol" error. I'm not sure that I've noticed that before.

Any insight would be appreciated.

SetError() #49: SSL_protocol: Unknown protocol 5000
Protocol Used:
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /v3/token HTTP/1.1
Host: marketplace.walmartapis.com
User-Agent: http-api/1.43
Content-Type: application/x-www-form-urlencoded
Content-Length: 29
Authorization: Basic - DELETED -
WM_PARTNER.ID: 10001667921
WM_QOS.CORRELATION_ID: 82B37F6E-C4A5-4675-AA4B-AC14A2CD33B7
WM_SVC.NAME: Walmart Marketplace
Accept: application/json

senddoc(): entered
grant_type=client_credentials
recvresp(): entered
SetError() #44: CommTCP_read: Socket has been shut down.
recvresp(): end with err
http_close(): entered
[Logo]<https://www.totalbizfulfillment.com/> Greg Wilburn
Director of IT
301.895.3792 ext. 1231
301.895.3895 direct
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx

1 Corporate Dr
Grantsville, MD 21536
www.totalbizfulfillment.com<http://www.totalbizfulfillment.com>
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Greg Wilburn
Director of IT
301.895.3792 ext. 1231
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.




Greg Wilburn
Director of IT
301.895.3792 ext. 1231
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 by midrange.com 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.