I trying to make a REST API POST request to an external Application from the Cloud page But getting 500 internal error. Can you please help me out with this on what mistake I'm doing
%%[
set @uname = "Harish"
set @pwd = "Password"
set @auth = Concat(@uname, @pwd)
set @url = "https://endpointurl.com"
set @payload = '{
"addSeminarCustomerInputField":{
"seminarCustomerField":{
"additionalAttendeesField":0,
"confirmedField":true,
"customer_IDField":1170,
"isHandicappedField":false,
"isHearingImpairedField":false,
"isVisionImpairedField":false,
"notesField":"Test Notes",
"seminar_IDField":3
}
}
}'
SET @req = HTTPPost2(@url, "application/json", @payload, false, @response, "Authorization", @auth)
]%%
Res = %%=v(@response)=%%
Postman code:
curl --location --request POST 'https://endpointurl.com' \
--header 'Authorization: Basic Q0JDX0FQSTpjYmNhcGkyMDIw' \
--header 'Content-Type: application/json' \
--header 'Cookie: ASP.NET_SessionId=on4xa3ow4hta45lipltm5x0w' \
--data-raw '{
"addSeminarCustomerInputField":{
"seminarCustomerField":{
"additionalAttendeesField":0,
"confirmedField":true,
"customer_IDField":1170,
"isHandicappedField":false,
"isHearingImpairedField":false,
"isVisionImpairedField":false,
"notesField":"Test Notes",
"seminar_IDField":3
}
}
}'