2

I have created a SOAP api post in postman that is supposed to pass the subscriberkey and a custom field (LoyaltyID) but the custom field doesn't look to be coming through.

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Header>
        <fueloauth>token</fueloauth>
    </Header>
    <Body>
        <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <Options/>
            <Objects xsi:type="TriggeredSend">
                <PartnerKey xsi:nil="true"/>
                <ObjectID xsi:nil="true"/>
                <TriggeredSendDefinition>
                    <PartnerKey xsi:nil="true"/>
                    <ObjectID xsi:nil="true"/>
                    <CustomerKey>Loyalty_Welcome_NU_DE</CustomerKey>
                </TriggeredSendDefinition>
                <Subscribers>
                    <PartnerKey xsi:nil="true"/>
                    <ObjectID xsi:nil="true"/>
                    <EmailAddress>parvez.halim+loyaltytest1@gmail.com</EmailAddress>
                    <SubscriberKey>0030N00xxxxxxx</SubscriberKey>
                    <LoyaltyID>a0X0N00xxxxxxxxx</LoyaltyID>
                </Subscribers>
            </Objects>
        </CreateRequest>
    </Body>
</Envelope>

and here is the ampscript on the triggered send email:

<!--%%[
VAR @futureDate, @today, @timestamp, @formattedDate, @url_yes, @RecordId, @subId, @subLanguage, @subscription, @subscriptionRow, @rowCount, @result, @loyalty

SET @today = Now(1) 
SET @timestamp = Format(@today, 'yyyy-MM-dd')
SET @futureDate = DateAdd(@today, 30, 'D')
SET @formattedDate = Format(@futureDate,'yyyy-MM-dd')

SET @RecordId = AttributeValue('SubscriberKey')
SET @loyalty = AttributeValue('LoyaltyID')

SET @subscription = RetrieveSalesforceObjects('MAG_Subscription__c','Subscription_ID__c, MAG_Language__c', 'MAG_Contact__c', '=', @RecordId)
SET @rowCount = rowCount(@subscription)

IF @rowCount > 0 THEN

    SET @subscriptionRow = Row(@subscription, @rowCount)
    SET @subId = FIELD(@subscriptionRow, 'Subscription_ID__c')
    SET @sublanguage = FIELD(@subscriptionRow, 'MAG_Language__c')

ENDIF

UpdateDE('Loyalty Welcome DE',1,'SubscriberKey',@RecordId,'SubscriptionID',@subId, LoyaltyID, @loyalty)

SET @url_yes = Concat('https://pub.s7.exacttarget.com/g3eu24p0efj?sk=',@subId,'&ln=',@subLanguage,'&expiry=',@formattedDate)

SET @result = UpdateSingleSalesforceObject('MAG_Subscription__c',@subId,'MAG_Status__c','Pending Verification')

SET @result = UpdateSingleSalesforceObject('MAG_Subscription__c',@subId,'MAG_VerifiedRequestDate__c', @timestamp)

]%%

I'm thinking that i cannot just add values within the tags. Any help would be very much appreciated.

1

Try to insert Custom Field value within Attributes which will be within <Subscribers> Tag.

<Subscribers>
                    <PartnerKey xsi:nil="true"/>
                    <ObjectID xsi:nil="true"/>
                    <EmailAddress>parvez.halim+loyaltytest1@gmail.com</EmailAddress>
                    <Attributes>
                          <Name>LoyaltyID</Name>                                                
                          <Value>a0X0N00xxxxxxxxx</Value>
                    </Attributes>
</Subscribers>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.