pub struct ContactsApiRecipients {
    pub client: Client,
}

Fields

client: Client

Implementations

Retrieve recipients.

This function performs a GET to the /contactdb/recipients endpoint.

This endpoint allows you to retrieve all of your Marketing Campaigns recipients.

Batch deletion of a page makes it possible to receive an empty page of recipients before reaching the end of the list of recipients. To avoid this issue; iterate over pages until a 404 is retrieved.

Parameters:

  • page: i64 – Page index of first recipients to return (must be a positive integer).
  • page_size: i64 – Number of recipients to return at a time (must be a positive integer between 1 and 1000).
  • on_behalf_of: &str – The license key provided with your New Relic account.

Add recipients.

This function performs a POST to the /contactdb/recipients endpoint.

This endpoint allows you to add a Marketing Campaigns recipient.

You can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides.

The rate limit is three requests every 2 seconds. You can upload 1000 contacts per request. So the maximum upload rate is 1500 recipients per second.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Delete Recipients.

This function performs a DELETE to the /contactdb/recipients endpoint.

This endpoint allows you to deletes one or more recipients.

The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Update Recipient.

This function performs a PATCH to the /contactdb/recipients endpoint.

This endpoint allows you to update one or more recipients.

The body of an API call to this endpoint must include an array of one or more recipient objects.

It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Get Recipient Upload Status.

This function performs a GET to the /contactdb/status endpoint.

This endpoint allows you to check the upload status of a Marketing Campaigns recipient.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Retrieve a single recipient.

This function performs a GET to the /contactdb/recipients/{recipient_id} endpoint.

This endpoint allows you to retrieve a single recipient by ID from your contact database.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Delete a Recipient.

This function performs a DELETE to the /contactdb/recipients/{recipient_id} endpoint.

This endpoint allows you to delete a single recipient with the given ID from your contact database.

Use this to permanently delete your recipients from all of your contact lists and all segments if required by applicable law.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Retrieve the lists that a recipient is on.

This function performs a GET to the /contactdb/recipients/{recipient_id}/lists endpoint.

This endpoint allows you to retrieve the lists that a given recipient belongs to.

Each recipient can be on many lists. This endpoint gives you all of the lists that any one recipient has been added to.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Retrieve the count of billable recipients.

This function performs a GET to the /contactdb/recipients/billable_count endpoint.

This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.

You are billed for marketing campaigns based on the highest number of recipients you have had in your account at one time. This endpoint will allow you to know the current billable count value.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Retrieve a Count of Recipients.

This function performs a GET to the /contactdb/recipients/count endpoint.

This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.

Parameters:

  • on_behalf_of: &str – The license key provided with your New Relic account.

Search recipients.

This function performs a GET to the /contactdb/recipients/search endpoint.

This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.

field_name:

  • is a variable that is substituted for your actual custom field name from your recipient.
  • Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200)
  • If field_name is a ‘reserved’ date field, such as created_at or updated_at, the system will internally convert your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through Mon, 02 Feb 2015 23:59:59 GMT.

Parameters:

  • field_name: &str – The license key provided with your New Relic account.
  • on_behalf_of: &str – The license key provided with your New Relic account.

Search recipients.

This function performs a POST to the /contactdb/recipients/search endpoint.

Search using segment conditions without actually creating a segment. Body contains a JSON object with conditions, a list of conditions as described below, and an optional list_id, which is a valid list ID for a list to limit the search on.

Valid operators for create and update depend on the type of the field for which you are searching.

  • Dates:
    • "eq", "ne", "lt" (before), "gt" (after)
      • You may use MM/DD/YYYY for day granularity or an epoch for second granularity.
    • "empty", "not_empty"
    • "is within"
  • Text: "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value), "empty", "not_empty"
  • Numbers: "eq", "lt", "gt", "empty", "not_empty"
  • Email Clicks and Opens: "eq" (opened), "ne" (not opened)

Field values must all be a string.

Search conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either clicks.campaign_identifier or opens.campaign_identifier. The condition value should be a string containing the id of a completed campaign.

Search conditions list may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or".

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more