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

 

 

 

 

Remove a Followed Article from User's List Code Samples

Use the code samples below as examples to create an application in your desired language. The following code samples use the /user/followed-articles endpoint to remove a followed article from the user's followed articles list. 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 Access token.

 

Code Samples

cURL
// Additional Documentation for Delete Followed Article

curl -X DELETE "https://apis.ebsco.com/medsapi-dynamed/v1/user/followed-articles"
    -H "Content-Type: application/json"
    -H "Accept: application/json"
    -H "Authorization: Bearer TOKEN"
    -d \
'{
  "pubType": "condition",
  "title": "malaria"
}'\

Java
// Additional Documentation for Delete Followed Article

// 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("user")
    .addPathSegment("followed-articles")
    .build();

// Build the body   
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{
  \"pubType\": \"condition\",
  \"title\": \"malaria\"
}");

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

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

JavaScript
// Additional Documentation [/user/article-views](https://developer.ebsco.com/medsapi-delete-followed-article)

const host = "https://apis.ebsco.com";
const path = "/medsapi-dynamed/v1/user/followed-articles";

// Create the Request
const url = host + path;

const settings = {
    "async": true,
    "crossDomain": true,
    "url": url,
    "method": "DELETE",
    "headers": {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer TOKEN"
    },
    "data": '{
  "pubType": "condition",
  "title": "malaria"
}'
};

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

Ruby
// Additional Documentation for Delete Followed Article

# Form the URL
urlstr = File.join("https://", "apis.ebsco.com", "/medsapi-dynamed/v1/user/followed-articles")
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::Delete.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Bearer TOKEN"
request.body = '{"pubType": "condition","title": "malaria"}'


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

Python
// Additional Documentation for Delete Followed Article

# Form the URL
url = "/medsapi-dynamed/v1/user/followed-articles"

payload =  '{"pubType": "condition", "title": "malaria"}'

# 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("DELETE", url, queryParams, headers)