Skip to main content

GET/email_campaign/audience

This method retrieves all available email newsletter audiences for the email campaign type specified by the emailCampaignType path parameter.

Use the optional limit and offset path parameters to paginate the results and to control which records are returned, respectively.

Input

Resource URI

GET https://api.ebay.com/sell/marketing/v1/email_campaign/audience?

This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com

URI parameters

ParameterTypeDescription
emailCampaignTypestringThe email campaign type to search against.

See CampaignTypeEnum for the full list of available email campaign types and associated enum values.

Occurrence: Required

limitintegerThe maximum number of audience groups returned per page in the results set.

Min value: 1

Max value: 200

Default value: 100

Occurrence: Optional

offsetintegerThe number of results to skip in a pagination query. This value cannot be less than 0.

Default value: 0

Occurrence: Optional

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

All other standard RESTful request headers are optional. For more information on standard RESTful request headers, see the HTTP request headers- opens rest request components page table.

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

https://api.ebay.com/oauth/api_scope/sell.marketing

See OAuth access tokens for more information.

Request payload

This call has no payload.

Request fields

This call has no field definitions.

Output

HTTP response headers

This call has no response headers.

Response payload

Response fields

Output container/fieldTypeDescription
audiencesarray of CampaignAudience

An array of audiences available for the specified email campaign type. If no audiences are available, the result will return an empty array.

Occurrence: Always

audiences.audienceTypeAudienceTypeEnum

This enum value indicates the audience type. For the complete list of audience types and their associated enum values, see AudienceTypeEnum.

Occurrence: Always

audiences.codestring

The unique code for an audience.

Occurrence: Always

audiences.namestring

The display name for an audience.

Occurrence: Always

hrefstring

The URL to the current page of store email campaign audiences.

Occurrence: Always

limitinteger

The value of the limit parameter submitted in the request, which is the maximum number of store email campaign audiences to return on a page from the result set.

Occurrence: Always

nextstring

The URI for the next page of results. This value is returned if there is an additional page of results to return from the result set.

Occurrence: Conditional

offsetinteger

This value indicates the offset used for the current page of store email campaign audiences returned.

Occurrence: Always

prevstring

The URI for the previous page of results. This is returned if there is a previous page of results from the result set.

Occurrence: Conditional

totalinteger

The total number of available audiences returned under the query conditions.

Occurrence: Always

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
200OK
400Bad Request
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
35000STORE_CRMAPPLICATIONInternal server error encountered. If this problem persists, contact the eBay Developers Program for support.
35001STORE_CRMBUSINESSA store subscription is required for this call, please check the store subscription status for current seller.
35101STORE_CRMREQUESTThe paginated query limit {limit} value is missing or invalid. The value cannot be less than or equal to zero.
35102STORE_CRMREQUESTThe paginated query offset {offset} value is mossing or invalid. The value cannot be less than zero.
35103STORE_CRMREQUESTThe email campaign type {emailCampaignType} is not supported. For the valid value, please see the documentation for this call.

Warnings

This call has no warnings.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Retrieve all Available Audiences for an Email Campaign Type

This method will retrieve all available audiences associated with the COUPON emailCampaignType.

Input

By setting the limit to 10 and the offset to 0, the seller wants to limit the number of audience codes returned per page to ten, and wants to view the first page of results. By setting emailCampaignType=COUPON, only audiences associated with the COUPON emailCampaignType will be returned.

GEThttps://api.ebay.com/sell/marketing/v1/email_campaign/audience?emailCampaignType=COUPON&limit=10&offset=0

Output

In this sample, 15 available audiences that match the requested type are returned. As the limit is set to 10, however, information on only the first 10 campaigns is returned on this page.

Got thoughts? Click the feedback button – your insights help us improve!