Intralinks Developer Portal

This guide provides a step-by-step outline for a common API use case - Downloading a document. The examples here are intended to show parameters needed to make a successful API call and presented in cURL since it is available on virtually every platform. Before beginning here you will need to create an app to get API keys. If you have not done this yet, please go through our getting started guide before continuing.

 

Logging in

The first thing you need to do is log in and get an access token. In this example we are going to use the client_credentials grant type since these will be your own credentials.
To login you will need the following pieces of information:

Item Description
client_id You can find this in the "KEYS" section of the app in the "My Apps" area of the developers portal
client_secret You can find this in the "KEYS" section of the app in the "My Apps" area of the developers portal
email This email username is what you use to log into Intralinks itself. NOTE: This is not the same as your username for logging into the developers portal.
password This password is what you use to log into Intralinks itself. NOTE: This is not the same as your username for logging into the developers portal.

API Reference: OAuth Token API

curl -X "POST" "https://test-api.intralinks.com/v2/oauth/token?grant_type=client_credentials" 
    -H "Content-Type: application/x-www-form-urlencoded" 
    --data-urlencode "email=<YOUR_EMAIL>" 
    --data-urlencode "password=<YOUR_PASSWORD>" 
    --data-urlencode "client_id=<YOUR_CLIENT_ID>" 
    --data-urlencode "client_secret=<CLIENT_SECRET>"

This API should return a response like this:

{
  "access_token": "7bSxew8sQbT9oODCAJAjR4sYqHYM",
  "token_type": "BearerToken",
  "expires_in": 3599,
  "email": "joe_user@intralinks.com"
}

You will need to keep track of the value for access_token as you will need it for the rest of your API calls.

 

List all my workspaces

The next task after logging in is to probably list all workspaces that you have access to. To do this we will use the workspaces api. With this API you will pass in the access token you got in the response from Step #1 above.

API Reference: List All Workspaces

curl -X "GET" "https://test-api.intralinks.com/v2/workspaces"
    -H "Authorization: Bearer <YOUR ACCESS_TOKEN>"
    -H "Accept: application/json"

This API should return an array of workspaces and their properties. Look for the ID parameter and save that for the next step.

 "status": {
    "code": 200,
    "message": "Request completed fine, no errors"
  },
  "workspace": [
    {
      "workspaceName": "Demo API Workspace",
      "parentTemplateId": 554961,
      "description": "This is a demonstration workspace for users of the Intralinks API",
      "host": "Intralinks",
      "securityLevel": 1,
      "type": "ARC",
      "statistics": {
        "newTasks": 0,
        "newParticipantRequests": 0
      },
      "pvpEnabled": "F",
      "version": 5,
      "name": "Demo API Workspace",
      "id": 701421,
      "phase": "OPEN"
    }
  ]
}

 

Enter a workspace

Now that we have the ID of the workspace we want to work with, the next step is to enter the workspace. Some workspaces have additional security or restrictions configured by the owners to ask user to provide further proof they are who they say they are. For details about how entering workspaces works please review our Entering workspaces documentation

API Reference: Enter Workspace

curl -X "POST" "https://test-api.intralinks.com/v2/workspaces/<WORKSPACE_ID>/splash" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer <YOUR ACCESS_TOKEN>" \
    -H "Content-Type: application/json" \
    -d "{\"acceptSplash\":true}"

If you pass all the requirements then you should receive a response back with a value of ALLOW in the state member like this:

{
  "status": {
    "code": 201,
    "message": "The entities have been created"
  },
  "state": "ALLOW"
}

 

Get folder contents

So far so good! Next step is to list the contents of the workspace so we can find the ID of the document we want to download. Documents cannot be created in the root of a workspace so we first need to find the right folder. We can do both operations - find the folder and find the document with the same set of APIs.

API Reference:
Get Workspace Folders
Get Folder Contents

curl -X "GET" "https://test-api.intralinks.com/v2/workspaces/<WORKSPACE_ID>/folders/" \
    -H "Authorization: Bearer <YOUR ACCESS_TOKEN>"

This API cal will return a list of folders in the current workspace. Next we grab the ID of the folder we want and call the /contents API like this:

curl -X "GET" "https://test-api.intralinks.com/v2/workspaces/<WORKSPACE_ID>/folders/<FOLDER_ID>/contents" \
    -H "Authorization: Bearer <YOUR ACCESS_TOKEN>"

This API returns a list of documents and folders within the specified folder looking for the value of DOCUMENT in the entityType member. When you find one you want, save the ID for the final step.

 

Download the file

OK, it's the moment of truth. With the ID of the file we want to download from the previous step all we need to do is download the file. For this we use the /Documents API.
For this API you do not need to have the folder id where the document lives, but you do need the workspace id and the document id. With those two IDs you can use the /file API to download the attachment.

curl -X "GET" "https://test-api.intralinks.com/v2/workspaces/<WORKSPACE_ID>/documents/<DOC_ID>/file" \
    -H "Authorization: Bearer <YOUR ACCESS_TOKEN>"

API Reference: Download File