Skip to main content

GET/email_campaign

This method retrieves a list of email campaigns from a seller's eBay store.

Users can filter the results by email campaign type, email campaign status, and marketplace ID using the q query parameter.

Input

Resource URI

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

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
limitintegerThe maximum number of email campaigns returned in a page.

Min value: 1

Max value: 200

Occurrence: Required

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

Default value: 0

Occurrence: Required

qstringThis field contains filter criteria for the results returned. Filter by email campaign type, email campaign status, and marketplace ID.

For example, setting q=campaignType:WELCOME,ITEM_SHOWCASE will return only Welcome and Item Showcase email campaigns.

Note: At least one campaignType value must be set through the q query parameter. If no other filters are set, all email campaigns for the specified campaign type(s) will be returned in the results set.

Occurrence: Required

sortstringThe criteria for sorting email campaign results. See ItemSortEnum for sorting options and their enum values.

Default: NEWLY_LISTED

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
campaignsarray of CampaignDTO

A list of email campaigns that match the search criteria.

Occurrence: Always

campaigns.audiencesarray of CampaignAudience

The audiences that the email campaign is being sent to. See AudienceTypeEnum for a list of audience types.

Occurrence: Always

campaigns.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

campaigns.audiences.codestring

The unique code for an audience.

Occurrence: Always

campaigns.audiences.namestring

The display name for an audience.

Occurrence: Always

campaigns.creationDatestring

The date and time that the email campaign was created, given in UTC format.

Occurrence: Always

campaigns.emailCampaignIdstring

The unique eBay identifier for the email campaign assigned automatically when the email campaign is created.

Occurrence: Always

campaigns.emailCampaignStatusEmailCampaignStatusEnum

The email campaign status. See EmailCampaignStatusEnum for information on statuses.

Occurrence: Always

campaigns.emailCampaignTypeCampaignTypeEnum

The email campaign type. See CampaignTypeEnum for definitions of email campaign types.

Occurrence: Always

campaigns.marketplaceIdstring

The eBay marketplace where the email campaign is active.

Occurrence: Always

campaigns.modificationDatestring

The date and time the email campaign was last modified, given in UTC format.

Occurrence: Conditional

campaigns.scheduleDatestring

The date and time that the email campaign newsletter is scheduled to send, given in UTC format.

Occurrence: Conditional

campaigns.scheduleDateTypeScheduleDateTypeEnum

The schedule type used for sending the email campaign. See ScheduleDateTypeEnum for available schedule types.

Occurrence: Conditional

campaigns.sentDatestring

The date and time that the email campaign was last sent, given in UTC format.

Occurrence: Conditional

campaigns.subjectstring

The email campaign subject line..

Occurrence: Conditional

hrefstring

The URL to the current page of store email campaigns.

Occurrence: Always

limitinteger

The value of the limit parameter submitted in the request, which is the maximum number of store email campaigns 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 current page of store email campaigns being 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

Total number of available results returned under the filter criteria submitted in the request.

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.
35301STORE_CRMREQUESTThe paginated query limit {limit} value is missing or invalid. The value cannot be less than or equal to zero and also cannot be greater than maximum value.
35302STORE_CRMREQUESTThe paginated query offset {offset} value is missing or invalid. The value cannot be less zero and also cannot be greater than maximum value.
35303STORE_CRMREQUESTThe query string {q} is malformed. For the valid format, see the documentation for this call.
35304STORE_CRMREQUESTThe email campaign type {campaignType} in query string {q} is not supported. For the valid values, see the documentation for this call.
35305STORE_CRMREQUESTThe 'marketplaceId' in query string {q} is not supported. For the valid values, see the documentation for this call.
35306STORE_CRMREQUESTThe email campaign status {status} in query string {q} is not supported. For the valid values, see the documentation for this call.
35307STORE_CRMREQUESTThe campaign type {campaignType} in query string {q} is required.

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 Email Campaigns for an eBay Store

This sample returns the details for email campaigns associated with a seller's eBay store.

Input

By setting the limit to 10 and the offset to 0, the seller wants to limit the number of email campaigns returned per page to ten, and wants to view the first page of results. By setting q to campaignType:WELCOME.ITEM_SHOWCASE, only email campaigns of this type will be returned.

GEThttps://api.ebay.com/sell/marketing/v1/email_campaign?limit=10&offset=0&q=campaignType:WELCOME,ITEM_SHOWCASE

Output

In this sample, 392 email campaigns 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!