The HoldingsIQ service retrieves vendor, package and title related information in JSON format. The service automates the managing of holdings data from different sources.

 

 

 

 

Get Related Orders for a Package Code Samples

Use the code samples below as examples to create an application in your desired language.  The following code samples use the /v1/{custid}/packages/{packageid}/orders endpoint which allows you to retrieve a list of GOBI eBook and EBSCO Subscription Services (ESS) E-Journal and Package Subscription orders associated with a particular package for a specific customer.  Get started and begin to understand the endpoint by following the examples below in the language of your choice. 

 

Code Samples

cURL

curl -X GET -H "accept: application/json" -H "x-api-key: APIKEY" \
"https://sandbox.ebsco.io/rm/rmaccounts/v1/CUSTID/packages/PACKAGEID/orders?lastorderid=24&pagesize=1"

Java

// Construct the client
OkHttpClient client = new OkHttpClient();

// Create the URL
HttpUrl url = new HttpUrl.Builder()
	.scheme("https")
	.host("sandbox.ebsco.io")
	.addPathSegment("rm")
	.addPathSegment("rmaccounts")
	.addPathSegment("v1")
	.addPathSegment(CUSTID)
	.addPathSegment("packages")
	.addPathSegment(PACKAGEID)
	.addPathSegment("orders")
	.addQueryParameter("lastorderid", "2233")
	.addQueryParameter("pagesize", "10")
	.build();

// Build the request
Request request = new Request.Builder()
      .url(url)
      .get()
      .addHeader("accept", "application/json")
      .addHeader("x-api-key", APIKEY)
      .build();

// Send the request
Response response = client.newCall(request).execute();


JavaScript

var host = "https://sandbox.ebsco.io/rm/rmaccounts/v1/";
var pathsega = "/packages/";
var pathsegb = "/orders";

// Create the Request
var urlstr = host + CUSTID + pathsega + PACKAGEID + pathsegb;
var settings = {
  "async": true,
  "crossDomain": true,
  "url": urlstr,
  "method": "GET",
  "data": { 
    "lastorderid": "200", 
    "pagesize": "20"
  },
  "headers": {
    "accept": "application/json",
    "x-api-key": APIKEY,
  }
}

// Send the Request
$.ajax(settings).done(function (response) {
  console.log(response);
});


Ruby

# Form the URL 
urlstr = File.join('https://', 'sandbox.ebsco.io', 'rm/rmaccounts/v1', CUSTID, 'packages', PACKAGEID, 'orders')
url = URI(urlstr)

#Query Parameters
query = URI.encode_www_form({
    # Request parameters
    'lastorderid' => '2244',
    'pagesize' => '20'
})
if query.length > 0
  if uri.query && uri.query.length > 0
    uri.query += '&' + query
  else
    uri.query = query
  end
end

# Create the HTTP object
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

# Create the request
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["x-api-key"] = APIKEY

# Send the request
response = http.request(request)


Python

# Form the URL
url = ''.join(['/rm','/rmaccounts/v1/', CUSTID, '/packages/', PACKAGEID, '/orders'])

# Create Connection Instance
conn = http.client.HTTPSConnection("sandbox.ebsco.io")

# Set the Query Parameters
params = urllib.parse.urlencode({'lastorderid': '24', 'pagesize': '10'})

# Create the Request Headers
headers = {
    'accept': "application/json",
    'x-api-key': APIKEY
    }

# Send Request  
conn.request("GET", url, headers=headers)

# Get Response
res = conn.getresponse()