I am trying to take all responses from Mobile Connect and dump them into a third party resource for analysis via an ampscript api. I am trying to do this within mobile connect using ampscript but I can't seem to get it to work!
Unfortunately there isn't much debugging in here so I am hoping someone with more expertise than I can assist.
Here is what I have tried:
%%[
Var @msgpass, @msgfail
SET @msgpass = "Stop Activated"
SET @msgfail = "Stop Not Activated"
IF indexof([MSG(0)], "STOP") > 0 THEN
OutputLine(v(@msgpass))
ELSE
OutputLine(v(@msgfail))
VAR @payload, @response
SET @payload = '{
"sender": {
"name": "Phillip J Fry",
"handle": "Phillip_Fry_the_Delivery_Guy"
},
"subject": "Question",
"body": "Didn't we used to be a delivery company?",
"attachments": [],
"metadata": {}
}'
SET @request = HTTPPost("https://api2.frontapp.com/Secret:)", "application/json", @payload, @response, "Authorization", "Bearer Secret :)", "Accept-Charset", "utf-8")
ENDIF
]%%