0

In my email I am also making a POST request to an internal Marketing Cloud API to do additional actions. The particular function I am using is HTTPPost2, the whole POST request code works fine if I preview the email or send to a subscriber and the API action gets carried out. However if I run the validation on an email, the last line after everything is prepared fails the validation.

/* SEND SMS */  
set @subscriberKey = AttributeValue("_subscriberkey")  
set @smsMessage = CONCAT('Your booking is at ', @timestamp, '. Dont be late!')
set @customerMobile = lookup("Account_Salesforce","PersonMobilePhone","External_ID__c",@CustomerId)
set @apiToken = "MY API KEY WILL GO HERE"
set @content = CONCAT('{
 "Subscribers": [{"MobileNumber": "', @customerMobile,'", "SubscriberKey": "', @subscriberKey , '"}],
 "Subscribe": true,
 "Resubscribe": true,
 "keyword": "TEST",
 "Override": true,
 "messageText": "', @smsMessage ,'"
}')

var @statusCode
var @response
set @post = HTTPPost2("https://www.exacttargetapis.com/sms/v1/messageContact/Mjo3ODow/send","application/json",@content,false,@statusCode, @response, "Authorization", CONCAT("Bearer " , @apiToken")

It is definitely something to do with the last line because as soon as I remove it the validation passes.

3
  • Hi, there appears to be something broken in the Concat function at the very end Oct 13, 2017 at 14:43
  • CONCAT("Bearer " , @apiToken"). The last quotation mark is out of place and likely to cause the error. Oct 13, 2017 at 14:45
  • You're right! Can you turn this into the answer thanks! Oct 13, 2017 at 14:57

1 Answer 1

0

The issue is the CONCAT("Bearer " , @apiToken") statement in the last line. The last quotation mark is out of place and likely to cause the error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .