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 Metadata Code Samples (Deprecated)

Use the code samples below as examples to create an application in your desired language. The following code samples use the /publishers/{publisherId}/documents/{documentId} endpoint which allows you to execute a request to retrieve article metadata by the unique ID assigned by the publisher. Get started and begin to understand the endpoint by following the examples below in the language of your choice.

 

Code Samples

cURL
# Article lookup for external document ID

curl -X GET "https://apis.ebsco.com/medsapi-dynamed/v1/publishers/{publisherId}/documents/{documentId}"
    -H "authorization: Bearer xyz"
    -H "Content-Type: application/json"
    -H "Accept: application/json"

Java
// Article lookup for external document ID

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

// Create the URL
HttpUrl url = new HttpUrl.Builder()
    .scheme("https")
    .host("apis.ebsco.com")
    .addPathSegment("medsapi-dynamed")
    .addPathSegment("v1")
    .addPathSegment("publishers")
    .addPathSegment("{publisherId}")
    .addPathSegment("documents")
    .addPathSegment("{documentId}")
    .build();


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

// Send the request
Response response = client.newCall(request).execute();
JavaScript
// Article lookup for external document ID

const host = "https://apis.ebsco.com";
const path = "/medsapi-dynamed/v1/publishers/{publisherId}/documents/{documentId}";

// Create the Request
const url = host + path;
const queryParams = {}

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

// Send the Request
$.ajax(settings).done(function (response) {
    console.log(response);
});
Ruby
# Article lookup for external document ID

# Form the URL
urlstr = File.join("https://", "apis.ebsco.com", "/medsapi-dynamed/v1/publishers/{publisherId}/documents/{documentId}")
url = URI.parse(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::Get.new(url)
request["authorization"] = "Bearer xyz"
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"


# Send the request
response = http.request(request)
Python
# Article lookup for external document ID

# Form the URL
url = "/medsapi-dynamed/v1/publishers/{publisherId}/documents/{documentId}"

queryParams = {}

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

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

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