×
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.
I have an api using qsys2.http_post that is working just fine when called
from ACS run sql scripts...
I'm moving it to embedded SQL in RPG and getting the following error when
running...
is 1. The error codes and their meanings follow:
1 -- The external program or service program returned SQLSTATE 38501. The
text message returned from the program is: ERROR : OPTION NOT JSON .
I have converted char for char... it is identical
Here is the embedded sql in rpg...
What is wrong and why am I getting this error?
l_url = '
https://api.twilio.com/2010-04-01/Accounts/'
%trim(l_apiKey)
'/Messages.json';
l_hdr = '{'
'"basicAuth":"'
%trim(l_apiKey) + ','
%trim(l_authToken) + '"'
',"header":"content-type,application/x-www-form-'
'urlencoded"'
',"sslTolerate":"true"'
'}';
l_bdy = '&To=+'
%char(i_phone)
'&From=REDACTED'
'&MessagingServiceSid='
%trim(l_msgSvcId)
'&Body='
%trim(i_msg);
exec sql
select ifnull("error_message",' ')
into :o_errorMsg
from json_table(
qsys2.http_post(:l_url
,cast(:l_hdr as varchar(855))
,cast(:l_bdy as clob(10k))
)
,'$' columns (
"error_message" char(100) path '$.error_message'
) error on error
) as x;
if sqlcode = 0;
return *on;
else;
return *off;
endif;
tia jay
As an Amazon Associate we earn from qualifying purchases.