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

 

 

 

 

Stage Holdings Code Samples

Use the code samples below as examples to create an application in your desired language.  The following code samples use the /{custid}/holdings endpoint which allows you to populate holdings data to a staging area.  Get started and begin to understand the endpoint by following the examples below in the language of your choice. 

 


curl -X POST --header 'Content-Type: application/json' \
 --header 'Accept: application/json' --header 'x-api-key: APIKEY' 'https://sandbox.ebsco.io/rm/rmaccounts/CUSTID/holdings'


// 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(CUSTID)
    .addPathSegment("holdings")
    .build();

// Build the body       
MediaType mediaType = MediaType.parse("application/octet-stream");
RequestBody body = RequestBody.create(mediaType, "");

// Build the request
Request request = new Request.Builder()
    .url(url)
    .post(body)
    .addHeader("cache-control", "no-cache")
    .addHeader("x-api-key", APIKEY)
    .addHeader("content-type", "application/json")
    .build();

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



var host = "https://sandbox.ebsco.io/rm/rmaccounts/";
var pathsega = "/holdings";

// Packages POST Sample
// Create the Request
var urlstr = host + CUSTID + pathsega;

var settings = {
  "async": true,
  "crossDomain": true,
  "url": urlstr,
  "method": "POST",
  "headers": {
    "x-api-key": APIKEY,
    "content-type": "application/json"
  },
  "data": ""
}

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



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

# 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::Post.new(url)
request["x-api-key"] = APIKEY
request["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'

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



# Form the URL
url = ''.join(['/rm','/rmaccounts/', CUSTID, '/holdings'])

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

# Payload
payload = ""

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

# Send Request  
conn.request("POST", url, payload, headers)