× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



We are on IBM I V7R2. I am using ACS SQLScripts v. 1.1.7.2

I am attempting to use httpgetclob and json_table to go to a vendor's (GetResponse), rest API.
I have tested the API in RPG usinig SK's LIBHTTP and it works like a charm.
However, when attempting it via an ACS SQL session using HTTPGETCLOB it is failing.

Here is the statement:

select * from JSON_TABLE(
SYSTOOLS.HTTPGETCLOB('https://api3.getresponse360.com/v3/contacts?query[email]=@worldnet.att.net'
,'Content-Type: application/json
X-Auth-Token: api-key 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3
X-Domain: email.ourdomain.com'
),'$'
Columns(contactid varchar(4) PATH 'lax $.contactid',
email varchar(100) PATH 'lax $.email',
changedOn varchar(20) PATH 'lax $.changedOn',
createdOn varchar(20) PATH 'lax $.createdOn')
) as t ;

I am getting this error:
SQL State: 38000
Vendor Code: -4302
Message: [SQL4302] Java stored procedure or user-defined function SYSTOOLS.HTTPGETCLOB, specific name HTTPG00005 aborted with an exception "Content is not allowed in prolog."

I am thinking that header statements:
'Content-Type: application/json
X-Auth-Token: api-key 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3
X-Domain: email.ourdomain.com'
are somehow causing the error and this is possibly a formatting issue.

1. Is there something obviously wrong with my statement?
2. Is there a debugging option I can turn on in the ACS SQL client to help me debug HTTPGETCLOB? I would love to determine the issue via my own resources if possible.
3. Perhaps HTTPGetClob is not what I really want to do?

Any and all help appreciated.

Paul

+++++ This email and related attachments may contain confidential information intended exclusively for the addressee. Unauthorized use, disclosure or distribution of this material is prohibited. If you received this message in error, please advise the sender and delete all copies of it. Content is provided by the individual sender and does not necessarily reflect the views of the Company. Though sender believes this transmission to be virus-free, it is the recipient's responsibility to ensure that it is.


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-2024 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.