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





Fetch Transfer Token Code Samples

Use the code samples below as examples to create an application in your desired language.  The following code samples use the /user/transfer-token endpoint which allows you to fetch a transfer token.  Get started and begin to understand the endpoint by following the examples below in the language of your choice. 


Code Samples

# Fetch a transferToken

curl -X POST ""
    -H "Authorization: Bearer Token"
    -H "x-eis-id-token: ID Token"
    -H "Content-Type: application/json"
    -H "Accept: application/json"

// Fetch a transferToken

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

// Create the URL
HttpUrl url = new HttpUrl.Builder()
    .addQueryParameter("toProductId", "dcd")

// Build the body
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{}")

// Build the request
Request request = new Request.Builder()
    .addHeader("Authorization", "Bearer Token")
    .addHeader("x-eis-id-token", "ID Token")
    .addHeader("Content-Type", "application/json")
    .addHeader("Accept", "application/json")

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

// Fetch a transferToken

const host = "";
const path = "/medsapi-dynamed/api/v1/user/transfer-token";

// Create the Request
const url = host + path;
const queryParams = {"toProductId": "dcd"}
const requestBody = {}

const settings = {
    "async": true,
    "crossDomain": true,
    "url": url,
    "method": "POST",
    "headers": {
        "Authorization": "Bearer Token",
        "x-eis-id-token": "ID Token",
        "Content-Type": "application/json",
        "Accept": "application/json"
    "processData": false,
    "data": JSON.stringify(requestBody)

// Send the Request
$.ajax(settings).done(function (response) {

# Fetch a transferToken

# Form the URL
urlstr = File.join("https://", "", "/medsapi-dynamed/api/v1/user/transfer-token")
url = URI.parse(urlstr)
params = { :toProductId => "dcd"  }

# Create the HTTP object
http =, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

# Create the request
request =
request["Authorization"] = "Bearer Token"
request["x-eis-id-token"] = "ID Token"
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request.body = {}

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

# Fetch a transferToken

# Form the URL
url = "/medsapi-dynamed/api/v1/user/transfer-token"

queryParams = {
        "toProductId": "dcd"}

# Payload
payload = {}

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

# Create the Request Headers
headers = {
        "Authorization": "Bearer Token",
        "x-eis-id-token": "ID Token",
        "Content-Type": "application/json",
        "Accept": "application/json"

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