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
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
Parameter | Type | Description |
---|---|---|
limit | integer | The maximum number of email campaigns returned in a page. Min value: 1 Max value: 200 Occurrence: Required |
offset | integer | The number of results to skip in a pagination query. This value cannot be less than zero. Default value: 0 Occurrence: Required |
q | string | This 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 |
sort | string | The 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/field | Type | Description |
---|---|---|
campaigns | array of CampaignDTO | A list of email campaigns that match the search criteria. Occurrence: Always |
campaigns.audiences | array of CampaignAudience | The audiences that the email campaign is being sent to. See AudienceTypeEnum for a list of audience types. Occurrence: Always |
campaigns.audiences.audienceType | AudienceTypeEnum | 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.code | string | The unique code for an audience. Occurrence: Always |
campaigns.audiences.name | string | The display name for an audience. Occurrence: Always |
campaigns.creationDate | string | The date and time that the email campaign was created, given in UTC format. Occurrence: Always |
campaigns.emailCampaignId | string | The unique eBay identifier for the email campaign assigned automatically when the email campaign is created. Occurrence: Always |
campaigns.emailCampaignStatus | EmailCampaignStatusEnum | The email campaign status. See EmailCampaignStatusEnum for information on statuses. Occurrence: Always |
campaigns.emailCampaignType | CampaignTypeEnum | The email campaign type. See CampaignTypeEnum for definitions of email campaign types. Occurrence: Always |
campaigns.marketplaceId | string | The eBay marketplace where the email campaign is active. Occurrence: Always |
campaigns.modificationDate | string | The date and time the email campaign was last modified, given in UTC format. Occurrence: Conditional |
campaigns.scheduleDate | string | The date and time that the email campaign newsletter is scheduled to send, given in UTC format. Occurrence: Conditional |
campaigns.scheduleDateType | ScheduleDateTypeEnum | The schedule type used for sending the email campaign. See ScheduleDateTypeEnum for available schedule types. Occurrence: Conditional |
campaigns.sentDate | string | The date and time that the email campaign was last sent, given in UTC format. Occurrence: Conditional |
campaigns.subject | string | The email campaign subject line.. Occurrence: Conditional |
href | string | The URL to the current page of store email campaigns. Occurrence: Always |
limit | integer | 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 |
next | string | 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 |
offset | integer | This value indicates the offset used for current page of store email campaigns being returned. Occurrence: Always |
prev | string | 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 |
total | integer | 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.
Status | Meaning |
---|---|
200 | OK |
400 | Bad Request |
500 | Internal Server Error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
35000 | STORE_CRM | APPLICATION | Internal server error encountered. If this problem persists, contact the eBay Developers Program for support. |
35001 | STORE_CRM | BUSINESS | A store subscription is required for this call, please check the store subscription status for current seller. |
35301 | STORE_CRM | REQUEST | The 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. |
35302 | STORE_CRM | REQUEST | The paginated query offset {offset} value is missing or invalid. The value cannot be less zero and also cannot be greater than maximum value. |
35303 | STORE_CRM | REQUEST | The query string {q} is malformed. For the valid format, see the documentation for this call. |
35304 | STORE_CRM | REQUEST | The email campaign type {campaignType} in query string {q} is not supported. For the valid values, see the documentation for this call. |
35305 | STORE_CRM | REQUEST | The 'marketplaceId' in query string {q} is not supported. For the valid values, see the documentation for this call. |
35306 | STORE_CRM | REQUEST | The email campaign status {status} in query string {q} is not supported. For the valid values, see the documentation for this call. |
35307 | STORE_CRM | REQUEST | The 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.