We are trying to connect our UniVerse (11.3.1.6022 running on AIX 7.2) to Klavyio to send emails.
The following works fine from Postman but the authorization line fails from U2 BASIC. We have tried multiple variations with no luck.
Seems like the SETREQUESTHEADER does not support this AUTH.CODE value.
Any ideas are appreciated.
Here are the essential code lines:
POSTURL = ENDPOINT <-- actual web address
POSTTYPE = "POST"
CONTENTTYPE = "application/vnd.api+json"
TOKEN = BRAND.API.KEY <-- proper key for specific web brand
AUTH.VALUE = "Klaviyo-API-Key ":TOKEN
RESULT = CREATEREQUEST(POSTURL, POSTTYPE, REQ_HANDLE)
returns RESULT=0
RESULT = SETREQUESTHEADER(REQ_HANDLE, "Content-Type", CONTENTTYPE)
returns RESULT=0
RESULT = SETREQUESTHEADER(REQ_HANDLE, "Accept", CONTENTTYPE)
returns RESULT=0
RESULT = SETREQUESTHEADER(REQ_HANDLE, "Host", "a.klaviyo.com")
returns RESULT=0
RESULT = SETREQUESTHEADER(REQ_HANDLE, "Authorization", AUTH.VALUE)
returns RESULT=2
------------------------------
Nelson Schroth
president
C3CompleteShop LLC
Harrison OH US
------------------------------