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

 

 

 

 

Update a Title Code Samples

Use the code samples below as examples to create an application in your desired language.  The following code samples use the /v2/{custid}/lists/{listid}/titles/{kbid} endpoint to update title details for a unique listid/kbid pair.  Get started and begin to understand the endpoint by following the examples below in the language of your choice. 

 

Code Samples

cURL

curl -X PUT "https://sandbox.ebsco.io/rm/rmaccounts/v2/CUSTID/lists/LISTID/titles/KBID" \
-H "accept: application/json" \
-H "x-api-key: APIKEY" -H "Content-Type: application/json" -d {"isSelected":true}

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("v2")
     .addPathSegment(CUSTID)
     .addPathSegment("lists")
     .addPathSegment(LISTID)
     .addPathSegment("titles")
     .addPathSegment(KBID)
     .build();

// Build the body	
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"isSelected\": true}");
		
// Build the request
Request request = new Request.Builder()
     .url(url)
     .put(body)
     .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/";
var pathsega = "v2/";
var pathsegb = "/lists/";
var pathsegc = "/titles/";

// Create the Request
var urlstr = host + pathsega + CUSTID + pathsegb + LISTID + pathsegc + KBID;
var settings = {
  "async": true,
  "crossDomain": true,
  "url": urlstr,
  "method": "PUT",
  "processData": false,
  "data": "{\"isSelected\": true}", 
  "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/v2', CUSTID, 'lists', 'LISTID', 'titles', 'KBID')
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::Put.new(url)
request["accept"] = 'application/json'
request["x-api-key"] = APIKEY
request["content-type"] = 'application/json'
request.body = "{ \"isSelected\": true}"

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


Python

# Form the URL
url = ''.join(['/rm','/rmaccounts/v2/', CUSTID, '/lists/', LISTID,'/titles/', KBID])

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

# Payload
payload = "{\"isSelected\": true }"

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

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