Home > API General, Auction > SWS GetRentalAuctionStatus Method

SWS GetRentalAuctionStatus Method


Checks a rental item’s auction status.

Parameters

Name DataType Is Required
RentalIDs Long Required
Description The rental item’s ID number. An array of rental IDs can be used. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
RentalStatus RentalAuctionStatus
Description The numeric value for the status of the auction.
Available values:

  • NotAuctionable – 0
  • AuctionScheduled – 1
  • AuctionCompleted – 2
  • AuctionRemoved – 3
  • AuctionNotSoldTerminated – 4
  • AuctionEligible – 5

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We’ll assume you have a web reference, let’s name it SWS, in your Visual Studio project. At this point we need to define the objects. We’ll need the standard service object, a GetRentalAuctionStatus request object, and a GetRentalAuctionStatus response object. We can define and create those like this:

// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetRentalAuctionStatus_Request request = new SWS.GetRentalAuctionStatus_Request();
SWS.GetRentalAuctionStatus_Response response;

Here’s a sample code of the Request object (including optional parameters):

// GetRentalAuctionStatus Request
request.SiteID = 123456;
request.RentalIDs = new long[] { 123546, 456789 };

Finally we can call the method and pass across the login object and the request object to retrieve the specified refunds. It’s a good idea to do this in a Try Catch block.

// Call the method that will load the response object
try
{
  response = service.GetRentalAuctionStatus(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You’ll want to capture the message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.

Categories: API General, Auction
  1. swsBecky
    December 15, 2016 at 3:56 pm

    Addendum 12-APR-2013: This method has been updated to return the correct status for rentals after being removed from, then re-placed into, auction status.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s