Discussions

How to access/set Contact object isBounceback meta data

Wayne Chan-Oracle
Wayne Chan-Oracle Posts: 34 Employee
edited Sep 4, 2020 3:45PM in Developer Tools

Hi REST/API team,

I need to access and set value of isBounceback meta data field from Contact object. Can you advise how to access and set this meta filed from contact object.

I use /api/rest/1.0/data/contacts?search="[email protected]" to retrieve a contact and it includes isBounceback value which I need to reset it if necessary.

I use /api/bulk/2.0/contacts/fields to retrieve all internal field name of contact Object but it did not include "isBounceback" as well as some other meta fields such as currentStatus, businessPhone as shown below. Can you advise how to set the isBounceback meta data field.

thanks,

Wayne Chan

{

   "elements": [

   {

   "type": "Contact",

   "currentStatus": "Awaiting action",

   "id": "xxxx",

   "createdAt": "xxxx",

   "depth": "complete",

   "name": "[email protected]",

   "updatedAt": "xxxx",

   "businessPhone": "1234",

   "country": "US",

   "emailAddress": "[email protected]",

   "emailFormatPreference": "unspecified",

   "fieldValues": [

   {

   "type": "FieldValue",

   "id": "100005"

   },

   {

   "type": "FieldValue",

   "id": "100017"

.....

  {

   "type": "FieldValue",

   "id": "100225",

   "value": "890210727"

   }

   ],

   "firstName": "xxxx",

   "isBounceback": "false",

   "isSubscribed": "true",

   "lastName": "xxx",

   "mobilePhone": "xxx",

   "subscriptionDate": "xxxx",

   "title": "xxxx"

   }

   ],

   "page": 1,

   "pageSize": 1000,

   "total": 1

}

Post edited by Unknown User on
Tagged:

Answers

  • Lou Patrick
    Lou Patrick Posts: 194 Bronze Trophy
    edited Jul 16, 2020 3:00PM

    isBounceback can not be set via the Application API, however; it can be set using the Bulk API.

    Example Definition:

    {    "name": "Set IsBounced",    "fields": {        "C_EmailAddress": "{{Contact.Field(C_EmailAddress)}}",        "IsBounced": "{{Contact.Email.IsBounced}}"    },    "identifierFieldName": "C_EmailAddress",    "isSyncTriggeredOnImport": true,    "dataRetentionDuration": "P7D",    "isUpdatingMultipleMatchedRecords": false,    "uri": "/contacts/imports/739",    "createdBy": "API.User",    "createdAt": "2020-07-16T18:46:58.7473890Z",    "updatedBy": "API.User",    "updatedAt": "2020-07-16T18:46:58.7473890Z"}

    To set isBounceback to true, import a value of 1 for IsBounced. To set isBounceback to false, import a value of 0 for IsBounced.

    Example, setting isBounceback to true for [email protected] and setting isBounceback to false for [email protected]:

    POST /api/Bulk/2.0/contacts/imports/739/data[    {        "C_EmailAddress": "[email protected]",        "IsBounced": "1"    },    {        "C_EmailAddress": "[email protected]",        "IsBounced": "0"    }]
  • Wayne Chan-Oracle
    Wayne Chan-Oracle Posts: 34 Employee
    edited Sep 2, 2020 7:01PM

    Hi Lou, thanks and want to circle back to you for further advises on how to work on bouncebacks using Bulk API.

    1. Per you advise I need to use exports to retrieve list of bounced back contacts... I'm having difficulty on how to set the filter for exports definition:

    {

        "name": "Set IsBounced",

        "fields": {

            "C_EmailAddress": "{{Contact.Field(C_EmailAddress)}}",

            "IsBounced": "{{Contact.Email.IsBounced}}"

        },

        "dataRentationDuration" : "PT1H",

        "filter" : "EXISTS('{{Contact.Email.IsBounced}}')"

    }

    Well from Eloqua API doc I should not use STATUS filter as it is intended for AppCloud so I use EXISTS filter. Doing so I got this error:

    {

        "failures": [

            {

                "field": "filter",

                "value": "EXISTS('{{Contact.Email.IsBounced}}')",

                "constraint": "Existence checks must have an ML Statement with a ContactList or ContactFilter, ContactSegment root

    Does this mean I need to compose a contact list for filtering and filter it : (ContactList AND isBounced) meaning all contacts in a selected contact list and the contact with attribute isBounced is set ??

    2. Your example on how to set isBounced suggests using Import API. To prepare import definition I need to specify destination and syncAction. Again do I need to set destination pointing to a contact list ?? What should syncAction should be set to ? I used Add/Delete before but not sure about setting an attribute this time for setting isBounced : 1 case. I use syncAction before (your advise ) to add contact to contact list as follow:

    {

      "name": "Email Address Import",

      "fields": {

        "EmailAddress": "{{Contact.Field(C_EmailAddress)}}"

      },

      "identifierFieldName": "EmailAddress",

      "syncActions": [

        {

          "destination": "{{ContactList[65]}}",

          "action": "add"

        }

      ]

    }

    This time around I thought it should be pretty much the same deal. fields is still EmailAddress I think. But not sure and puzzled about how I should setup syncActions part... So I seek your advise again.

    thanks,

    Wayne Chan

  • Wayne Chan-Oracle
    Wayne Chan-Oracle Posts: 34 Employee
    edited Sep 2, 2020 7:21PM

    Lou,

    I found in Eloqua API doc there is an action type "setStatus" for syncAction. That answered one of my questions about defining import definition.

    I also found syncAction can set destination to {{GlobalSubscribe}} to refer to all Email Groups but still not sure if there is a {{GlobalContactList}} to refer to all contact lists or {{GlobalSegment}} to refer to all segments as valid filter...

    thanks,

    Wayne Chan

  • Wayne Chan-Oracle
    Wayne Chan-Oracle Posts: 34 Employee
    edited Sep 2, 2020 9:25PM

    Lou,

    I figured out how to setup imports and upload data to Eloqua to reset bounced back status of contact object.

    the body of /bulk/2.0/contacts/imports is:

    {

       "name": "Set IsBounced",

       "fields": {

       "C_EmailAddress": "{{Contact.Field(C_EmailAddress)}}",

       "IsBounced": "{{Contact.Email.IsBounced}}"

       },

       "identifierFieldName": "C_EmailAddress",

       "dataRentationDuration" : "PT1H"

    }

    It actually does not need syncAction so having imports definition done I can proceed to /bulk/2.0/contacts/imports/nnn/data to imports data to Eloqua using the bounced back JSON data body you suggested. After that I called /bulk/2.0/syncs to move data from staging to contact objects. Lastly I called /bulk/2.0/syncs/mmm to verify success status to complete the upload.

    Yes it is a good that this seems less complicated than I thought originally. I still having problem getting the export definition setup .. Hope to hear for your advise soon. thx

    Wayne Chan

  • Lou Patrick
    Lou Patrick Posts: 194 Bronze Trophy
    edited Sep 4, 2020 3:40PM

    You can filter using the IsBounced field using a value of "1" for true and "0" for false. Examples:

    Retrieve all bounced contacts:

    POST /api/Bulk/2.0/contacts/exports{  "name": "IsBounced - true",  "fields": {    "C_EmailAddress": "{{Contact.Field(C_EmailAddress)}}",    "IsBounced": "{{Contact.Email.IsBounced}}"  },  "filter": "'{{Contact.Email.IsBounced}}'='1'"}

    Retrieve all contacts that are not bounced:

    POST /api/Bulk/2.0/contacts/exports{  "name": "IsBounced - false",  "fields": {    "C_EmailAddress": "{{Contact.Field(C_EmailAddress)}}",    "IsBounced": "{{Contact.Email.IsBounced}}"  },  "filter": "'{{Contact.Email.IsBounced}}'='0'"}
  • Lou Patrick
    Lou Patrick Posts: 194 Bronze Trophy
    edited Sep 4, 2020 3:45PM

    Regarding sync actions, there are separate sync actions for email groups and global. There is not a sync action to update all email groups, they must be modified one at a time. See the Sync actions reference page for more information.

    There is not a global filter for all segments or lists, you can only filter on one segment or one list at a time.