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

 

 

 

 

Get Article Views Code Samples

Use the code samples below as examples to create an application in your desired language. Get started and begin to understand the endpoint by following the examples below in the language of your choice.  To use this endpoint you will need a valid Personal User Authentication token.

 

Code Samples

cURL

# Your GET endpoint

curl -X GET "https://apis.ebsco.com/api/v1/user/article-views?maxItems=10"
-H "authorization: Bearer TOKEN"
-H "Content-Type: application/json"
-H "Accept: application/json"


Java

// Your GET endpoint

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

// Create the URL
HttpUrl url = new HttpUrl.Builder()
.scheme("https")
.host("apis.ebsco.com")
.addPathSegment("api")
.addPathSegment("v1")
.addPathSegment("user")
.addPathSegment("article-views")
.addQueryParameter("maxItems", "10")
.build();

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

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

JavaScript

// Your GET endpoint

const host = "https://apis.ebsco.com";
const path = "/api/v1/user/article-views";

// Create the Request
const url = host + path;
const queryParams = {"maxItems": 10}

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

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

Ruby

# Your GET endpoint

# Form the URL
urlstr = File.join("https://", "apis.ebsco.com", "/api/v1/user/article-views")
url = URI.parse(urlstr)
params = { :maxItems => 10 }

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


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

Python

# Your GET endpoint

# Form the URL
url = "/api/v1/user/article-views"

queryParams = {
"maxItems": 10}

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

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

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