Skip to main content
Published: January 27 2017, 6:33:00 AMUpdated: January 27 2022, 10:13:40 PM

How to upload images to EPS using eBayPictureService in C#

You can use the eBayPictureService class available in the SDK to upload pictures from your local machine to EPS and store the PictureURLs in your local database for future use. Please be aware that you must add an item that uses the uploaded images within five days for Trading API calls and within ten days for Large Merchant Services calls; unassociated pictures are automatically deleted after that period.
 

Below is a sample AddFixedPriceItem request that lists items in DE site with unit price details showing in the viewItem page.

Sample request for uploading images from local machine

/* 2012-2013 eBay Inc., All Rights Reserved */
/* Licensed under CDDL 1.0 - http://opensource.org/licenses/cddl1.php */

using System;
using System.Collections.Generic;
using System.Text;
using eBay.Service.EPS;
using eBay.Service.Core.Sdk;
using eBay.Service.Core.Soap;

namespace eBayPictureService_Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                ApiContext context = new ApiContext();
                context.ApiCredential.eBayToken = "Your_Token_Here";
                context.Site = SiteCodeType.US;
                context.SignInUrl = @"https://api.sandbox.ebay.com/wsapi";
                eBayPictureService pictureService = new eBayPictureService(context);
                pictureService.ApiContext.EPSServerUrl = @"https://api.sandbox.ebay.com/ws/api.dll";
                string[] pictureList = { @"C:\Users\dsampath\Pictures\New folder\multi-color.jpg", @"C:\Users\dsampath\Pictures\New folder\black-1.jpg", @"C:\Users\dsampath\Pictures\New folder\black-2.jpg", @"C:\Users\dsampath\Pictures\New folder\blue.jpg" };
                string[] picURLs = pictureService.UpLoadPictureFiles(PhotoDisplayCodeType.SuperSize, pictureList);
                Console.WriteLine("EPS Picture URLs:");
                foreach (string pic in picURLs)
                {
                    Console.WriteLine(pic);
                }
                Console.ReadLine();


            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

 

 

How well did this answer your question?
Answers others found helpful