GET/email_campaign/{email_campaign_id}/email_preview
This method returns a preview of the email sent by the email campaign indicated by the email_campaign_id path parameter.
Call getEmailCampaigns to obtain a list of email campaigns. Use the emailCampaignId value of the desired email campaign as the email_campaign_id path parameter value.
If this call is executed successfully, the response returns a content field that contains the raw HTML code of the email campaign that can then be rendered anywhere.
Note: The eBay listings in the email are sorted according to the email campaign sort criteria. The individual listings can change over time, as well.
The result of the email preview call can be treated as a snapshot of the email campaign taken at the date and time of the renderDate value found in the results of the call.
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 |
---|---|---|
email_campaign_id | string | This path parameter specifies the unique eBay assigned identifier for the email campaign associated with the preview being retrieved. Use the getEmailCampaigns method to retrieve a list of email campaign IDs for a seller. Occurrence: Required |
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 |
---|---|---|
content | string | The raw HTML code of the email campaign contents. The client side can use this HTML output directly. Occurrence: Always |
renderDate | string | The date and time when a "snapshot" of the email campaign contents contained in the content result was taken. Given in UTC format. 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. |
35601 | STORE_CRM | REQUEST | No email campaign found for email campaign ID {email_campaign_id}. |
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 a Preview of an Email Campaign
This method returns a preview of an email campaign specified by a email_campaign_id.
Input
The email_campaign_id path parameter is required in order to specify the email campaign to retrieve. In this sample, the email_campaign_id is 4********2
. This call has no request payload.
GEThttps://api.ebay.com/sell/marketing/v1/email_campaign/4********2/email_preview
Output
If the call is successful, a content
field is returned that contains the HTML code of the email campaign. This HTML can then be rendered to see a preview of the email campaign. The renderDate
for the preview is also returned.