You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
Because the examples use PHP, Java, and .NET -- it's a little hard to translate to fuel-node-soap.
In the edited fragment below, I can successfully subscribe someone to a list without a problem: First I i try to create the subscriber on the list; if I learn the subscriber already exists I do an update.
I have no trouble unsubscribing them from the list too (not shown here).
However, if I try to subscribe the Subscriber again, when the Subscriber already has a status of 'Unsubscribed', I am not able to set the Subscriber's status to Active unless I use the Update action.
But I don't know what state the subscriber is in -- non existent, or exists-but-unsubscribed -- therefore I don't know whether to do a create or an add. I call your attention to the SaveOptions. Isn't that supposed to give me essentially an Upsert ability? I have this feeling that I'm specifying the SaveOption incorrectly below. Any clues?
letsoapClient=newFuelSoap(fuelOptions);letoptions={"SaveOptions": [{"SaveAction": "UpdateAdd","PropertyName": "*"}]};letprops={"EmailAddress": [emailaddress],"SubscriberKey": [subscriberkey],"Attributes": [],"Lists": [{'ID': [listID],'Status': 'Active','StatusSpecified': true,'IDSpecified': true,'Action': 'Create'}]};constERR_SUBONLIST="12014";constERR_ONLISTALREADY="13006";soapClient.create('Subscriber',props,options,function(err){if(err){if(_.first(err.results).ErrorCode===ERR_SUBONLIST){props.Lists[0].Action='Update';soapClient.update('Subscriber',props,options,function(e){if(!e){// success}else{if(_.first(e.results).ErrorCode===ERR_ONLISTALREADY){// you are already on the list}else{// failure}}});}else{// failure}}else{// success}});
The text was updated successfully, but these errors were encountered:
@balexandre Wow, you're responding to an issue I sent nearly three years ago! Regrettably, I no longer remember, as the company moved on to using Campaign Monitor.
In case someone comes across this issue in the future - the change to make to the above code is to perform an upsert by removing the prop 'Action': 'Create' from the first object in the Lists array.
There are some really good docs on subscribing a user to a list here:
https://code.exacttarget.com/apis-sdks/soap-api/adding-subscribers-to-a-list.html
Because the examples use PHP, Java, and .NET -- it's a little hard to translate to fuel-node-soap.
In the edited fragment below, I can successfully subscribe someone to a list without a problem: First I i try to create the subscriber on the list; if I learn the subscriber already exists I do an update.
I have no trouble unsubscribing them from the list too (not shown here).
However, if I try to subscribe the Subscriber again, when the Subscriber already has a status of 'Unsubscribed', I am not able to set the Subscriber's status to Active unless I use the Update action.
But I don't know what state the subscriber is in -- non existent, or exists-but-unsubscribed -- therefore I don't know whether to do a create or an add. I call your attention to the
SaveOptions
. Isn't that supposed to give me essentially an Upsert ability? I have this feeling that I'm specifying the SaveOption incorrectly below. Any clues?The text was updated successfully, but these errors were encountered: