Dynamic Health Partner

 

Browse our guides and interact with our API reference for more information about MEDSAPI EBSCO Partner. Try the API and learn about core concepts.

 

 

 

 

Get Content Set Exclusions Code Samples

Use the code samples below as examples to create an application in your desired language.  The following code samples use the GET /content/content-set-exclusions endpoint which allows you to get all excluded content sets. Get started and begin to understand the endpoint by following the examples below in the language of your choice. 

 

Code Samples

cURL

# Retrieve excluded content sets for a given customer

curl -X GET "https://apis.ebsco.com/medsapi-dynamic-health/v1/content/content-set-exclusions?customerId=n12345&productFamily=nahp&type=pubType"
    -H "Content-Type: application/json"
    -H "Accept: application/json"
    -H "Authorization: Bearer TOKEN"


Java

// Retrieve excluded content sets for a given customer

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

// Create the URL
HttpUrl url = new HttpUrl.Builder()
    .scheme("https")
    .host("apis.ebsco.com")
    .addPathSegment("medsapi-dynamic-health")
    .addPathSegment("v1")
    .addPathSegment("content")
    .addPathSegment("content-set-exclusions")
    .addQueryParameter("customerId", "n12345")
    .addQueryParameter("productFamily", "nahp")
    .addQueryParameter("type", "pubType")
    .build();


// Build the request
Request request = new Request.Builder()
    .url(url)
    .get()
    .addHeader("Content-Type, "application/json")
    .addHeader("Accept, "application/json")
    .addHeader("Authorization, "Bearer TOKEN")
    .build();

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

JavaScript

// Retrieve excluded content sets for a given customer

const host = "https://apis.ebsco.com";
const path = "/medsapi-dynamic-health/v1/content/content-set-exclusions";

// Create the Request
const url = host + path;
const queryParams = {"customerId": "n12345", "productFamily": "nahp", "type": "pubType"}

const settings = {
    "async": true,
    "crossDomain": true,
    "url": url,
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer TOKEN"
    },
    "data": queryParams
};

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

Ruby

# Retrieve excluded content sets for a given customer

# Form the URL
urlstr = File.join("https://", "apis.ebsco.com", "/medsapi-dynamic-health/v1/content/content-set-exclusions")
url = URI.parse(urlstr)
params = { :customerId => "n12345",:productFamily => "nahp",:type => "pubType" }

# Add params to URI
uri.query = URI.encode_www_form( params )

# 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["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Bearer TOKEN"


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

Python

# Retrieve excluded content sets for a given customer

# Form the URL
url = "/medsapi-dynamic-health/v1/content/content-set-exclusions"

queryParams = {
    "customerId": "n12345"
    "productFamily": "nahp"
    "type": "pubType"}

# Create Connection Instance
conn = http.client.HTTPSConnection("apis.ebsco.com")

# Create the Request Headers
headers = {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer TOKEN"
}

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