Marketplaces / eBay / Functional Scope eBay PBSE / eBay GPSR Incorporation / Upload Images

Upload Images

Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)

Date Version Name Applied changes
30.10.2024 v1.0 Bogomil First Publish

In order to upload the images to eBay we will have to use the UploadSiteHostedPictures and store each image eBay URL in Hemi which we will use in the other product calls. We want to make the process as seamless as possible so we want to introduce the same logic like we have for eBay videos. We want to get all unique image urls from Account Marketplace eBay >Energy Efficiency Label Image OR Product Account eBay >Energy Efficiency Label Image OR Account Marketplace eBay > Product Sheet Image OR Product Account eBay >Product Sheet Image and store them in a separate table called eBay Images where we want to have the Image URL, External URL and Expiry Date

eBay Images

Field Name Type Comment
Image URL varchar
External URL varchar
Expiry Date varchar
Account Id varchar
eBay Status varchar
eBay Error varchar

So the whole flow will look like we will have all the image urls added in the Account and Product Account eBay and we want to get all unique urls and store them in eBay Images without the External URLs. Then the cron which actually upload the images will have to pick all urls with missing External URLs and upload them on eBay using the UploadSiteHostedPictures call.

The first step is to obtain the document id with the CreateDocument call.

API Call: POST [https://api.ebay.com/ws/api.dll](https://api.ebay.com/ws/api.dll) API Docs: https://developer.ebay.com/devzone/xml/docs/reference/ebay/uploadsitehostedpictures.html#Samples

Sample Request: **POST[https://api.ebay.com/ws/api.dll](https://api.ebay.com/ws/api.dll)

Sample Body:

<?xml version="1.0" encoding="utf-8"?>
<UploadSiteHostedPicturesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <!-- Call-specific Input Fields -->
  <ExtensionInDays> int </ExtensionInDays>
  <ExternalPictureURL> anyURI </ExternalPictureURL>
  <PictureData contentType="string"> Base64BinaryType (base64Binary) </PictureData>
  <PictureName> string </PictureName>
  <PictureSet> PictureSetCodeType </PictureSet>
  <PictureSystemVersion> int </PictureSystemVersion>
  <PictureUploadPolicy> PictureUploadPolicyCodeType </PictureUploadPolicy>
  <!-- Standard Input Fields -->
  <ErrorLanguage> string </ErrorLanguage>
  <MessageID> string </MessageID>
  <Version> string </Version>
  <WarningLevel> WarningLevelCodeType </WarningLevel>
</UploadSiteHostedPicturesRequest>

Mapping:

eBay Field Hemi Field Required Comment
ExtensionInDays N/A
ExternalPictureURL eBay Images > Image URL Yes
PictureData N/A
PictureName Product Account > Tittle No If the image is set on an Account level we do not want to push the PictureName.
PictureSet N/A
PictureSystemVersion N/A
PictureUploadPolicy N/A
ErrorLanguage N/A
MessageID N/A
Version N/A
WarningLevel N/A

Sample Request:

<?xml version="1.0" encoding="utf-8"?>
<UploadSiteHostedPicturesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken><![CDATA[v^1.1#i^1#r^1#p^3#f^0#I^3#t^Ul4xMF80OkJEOTkyMjlCOEU1RjdFRUJCNUZFQjBGOTlDMDA5NDFEXzBfMSNFXjI2MA==]]></eBayAuthToken>
  </RequesterCredentials>
  <WarningLevel>High</WarningLevel>
  <ExternalPictureURL>https://test.info/test/test/SKU0051a.png</ExternalPictureURL>
  <PictureName>Test Image</PictureName>
</UploadSiteHostedPicturesRequest>

Sample Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<UploadSiteHostedPicturesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
    <Timestamp>2024-11-08T17:05:26.022Z</Timestamp>
    <Ack>Success</Ack>
    <Version>0</Version>
    <Build>mediasvcs-5.0.34_20241107030145770</Build>
    <HardExpirationWarning>2022-04-29 03:59:28</HardExpirationWarning>
    <PictureSystemVersion>2</PictureSystemVersion>
    <SiteHostedPictureDetails>
        <PictureName>Test Image</PictureName>
        <PictureSet>Standard</PictureSet>
        <PictureFormat>PNG</PictureFormat>
        <FullURL>https://i.ebayimg.com/00/s/MTYwMFgxMjAw/z/zdMAAOSw6nhnLkTV/$_1.PNG?set_id=2</FullURL>
        <BaseURL>https://i.ebayimg.com/00/s/MTYwMFgxMjAw/z/zdMAAOSw6nhnLkTV/$_</BaseURL>
        <PictureSetMember>
            <MemberURL>https://i.ebayimg.com/00/s/MTYwMFgxMjAw/z/zdMAAOSw6nhnLkTV/$_1.PNG</MemberURL>
            <PictureHeight>400</PictureHeight>
            <PictureWidth>300</PictureWidth>
        </PictureSetMember>
        <ExternalPictureURL>https://test.info/test/test/SKU0051a.png</ExternalPictureURL>
        <UseByDate>2024-12-08T17:05:23.572Z</UseByDate>
    </SiteHostedPictureDetails>
</UploadSiteHostedPicturesResponse>

Response Mapping:

eBay Field Hemi Field Comment
Timestamp N/A
Ack N/A
Version N/A
Build N/A
PictureSystemVersion N/A
SiteHostedPictureDetails
PictureName N/A
PictureSet N/A
PictureFormat N/A
FullURL eBay Images > External URL
BaseURL N/A
PictureSetMember
MemberURL N/A
PictureHeight N/A
PictureWidth N/A
ExternalPictureURL N/A
UseByDate eBay Images >Expiry Date

For each image we want to store the FullURl and the UsedByDate in Hemi and if we have UsedBydate older than NOW() we want to retrited the request and generate a new eBay URL.

Is this article helpful?
0 0 0