Skip to main content
deleted 4 characters in body
Source Link

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    set @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SETSET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    set @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    set @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')

Is there a way to pass a unique key to next message from current message through API?

edited body
Source Link

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    seyset @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    sey @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    set @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

edited tags
Source Link
Lukas Lunow
  • 22.2k
  • 4
  • 27
  • 59

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
  VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
set @mobileNumber = "xxxxxx"
set @skey="123#Test"
sey @cpk1="123##Test"
SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
SET @apitoken = Substring(@apistatusCode,18,512)
IF @httppost ==  200 THEN
SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
 
  SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
ENDIF
]%%
%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    sey @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
  VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
set @mobileNumber = "xxxxxx"
set @skey="123#Test"
sey @cpk1="123##Test"
SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
SET @apitoken = Substring(@apistatusCode,18,512)
IF @httppost ==  200 THEN
SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
 
  SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

I am trying to trigger outbound SMS for another outbound SMS, I am able to trigger it but not able to pass the subscriber key and attributes in the payload. Below is the script that's working with only mobile number in the content.

%%[
    VAR @apiid,@url,@exec,@accessToken,@mobileNumber,@OMedia,@apiresponse,@apistatusCode,@statusCode,@response,@httppost,@apitoken,@skey,@cpk1
    set @mobileNumber = "xxxxxx"
    set @skey="123#Test"
    sey @cpk1="123##Test"
    SET @apiid = '{"client_id": "xxxxxx","client_secret": "xxxxx", "grant_type": "client_credentials"}'
    SET @httppost = HTTPPost2("https://subdomain.auth.marketingcloudapis.com/v2/token","application/json",@apiid,false,@apistatusCode,@apiresponse)
    SET @apitoken = Substring(@apistatusCode,18,512)
    IF @httppost ==  200 THEN
    SET @OMedia = concat('{"mobileNumbers":[', @mobileNumber,']}')
     
      SET @url ="https://subdomain.rest.marketingcloudapis.com/sms/v1/messageContact/**smskey**/send/"
    SET @exec = HTTPPost2(@url,"application/json",@OMedia,true,@statusCode,@response,'Authorization',CONCAT("Bearer ", @apitoken)) 
    ENDIF
]%%

but when I try to pass attributes in the payload content like below its not working

**SET @OMedia = concat('{"Subscribers": [{"mobileNumbers":[', @mobileNumber,'],"SubscriberKey": [',@skey,'],"Attributes":{"COMPOSITE_PRIMARY_KEY":[', @cpk1,']}}]}')**

Is there a way to pass a unique key to next message from current message through API?

added 68 characters in body
Source Link
Loading
Source Link
Loading