Intralinks Developer Portal

Overview

Providers - Providers define the base configuration and connection properties for the content storage providers that Intralinks supports. The providers available to individuals may be restricted based on organization or business group policies.

Accounts - Accounts represent an instance of a provider for a particular individual. Accounts have access to the base provider connection data in addition to a users specific connection credentials needed to access the provider.’

Objects - Objects are any of the artifacts that the storage provider contains. Currently the IL Storage API represents all artifacts as either containers (ie, folders, or repositories) and data objects (ie files)

 

Login

To begin using the connector api you must first log into your Intralinks account using the OAuth APIs. If you are new to OAuth check out our Authentication guide.

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
Consumer Key You can find this in the "KEYS" section of the app in the "My Apps" area of the developers portal
Consumer Secret You can find this in the "KEYS" section of the app in the "My Apps" area of the developers portal
Username This 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.
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.

API Reference:
OAuth Token API

 

List Providers

Once logged in, you first need to pull a list of storage providers that you have access to using the Providers API. The providers API returns an array with the details each of the provider. There is only a single call you need to make:

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

The key attributes in the response are providerName and providerId. You will need the ID in the next step to configure an account.

 

API Reference:
Providers API

 

Connect to your storage

Using the ID from the providers API, the next step is to establish a connection to that account. To establish the connection all you need to do is call the Authorize API and provide the provider id from above.

NOTE: Currently the only providers Intralinks supports are those that use browser based OAuth authentication methods. As a result, you will need to facilitate the next steps using an application that supports browser redirects or directly in a browser.

curl -X "POST" "https://test-api.intralinks.com/v1/il-storage/accounts/authorize/{provider_id} \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

At this point, you will need to be able to open a web browser. From there you will log into your provider directly. Once you log in, the provider will redirect your browser to the Intralinks server and we will store the auth tokens with your connector account details.

If all goes well you can issue a call to the GET accounts API to verify that your account was successfully created.

curl -X "GET" "https://test-api.intralinks.com/v1/il-storage/accounts" \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

The response will contain an array of storage account objects that represent existing connections to various providers.

"storageAccounts": [
    {
      "accountId": 110865,
      "accountName": "DemoDropBox",
      "providerId": 2000,
      "ilUserId": 168331,
      "authenticationInfo": {
        "authenticationType": "oAuth",
        "authenticationDetails": {
          "token": "<dropbox_access_token>"
        }
      },
      "createdAt": "2016-06-23T14:46:08.000Z",
      "createdBy": "168331",
      "modifiedAt": "2016-07-27T14:36:53.000Z",
      "modifiedBy": "168331"
    }
  ]
}

In the response, you will want to make note of the accountId for use in the rest of the Connector API calls.

 

API Reference:
Create Account
List Accounts

 

Understanding Objects

Once you have established a connection to a storage provider, the next thing to understand is how our API structures the data. We have based the Connector API on an industry specification called Cloud Data Management Interface (CDMI)

Object Conventions

CDMI defines the basic structure of the API and the objects that are returned. In our API we support two objects:

  • Containers -- These are objects that can contain other objects. Typically this will be a folder or similar structure.
  • DataObjects -- These are nont

And for each object there are two ways to address them:

  • By Path
  • By ID

CDMI also defines two MIME types for use with APIs to inform the server what kind of object you are referring to when it could be ambiguous through the path or ID alone. These MIME types can be referred to in the Accept or Content-Type headers or in the JSON objects themselves.

  • application/cdmi-container
  • application/cdmi-object

 

Working with Containers

The first task after setting up an account is to get a listing of all the content in the root of your account. To do this simply refer to the accountId from your list of configured accounts and use the GET Objects call.

curl -X "GET" "https://test-api.intralinks.com/v1/il-storage/accounts/<ACCOUNT_ID>/objects/" \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
    -H "Content-Type: application/json"

The result from this call will be an array of CDMI objects.

{
  "objects": [
    {
      "objectType": "application/cdmi-object",
      "objectId": "L3ByZXNlbnRhdGlvbi5wcHQ=",
      "objectName": "presentation.ppt",
      "parentID": "",
      "parentURI": "",
      "completionStatus": "Completed",
      "lastModifiedAt": "2012-04-26T22:16:18.000Z"
    },
    {
      "objectType": "application/cdmi-object",
      "objectId": "L1E0IFByb2plY3QgUGxhbi5kb2N4",
      "objectName": "Q4 Project Plan.docx",
      "parentID": "",
      "parentURI": "",
      "completionStatus": "Completed",
      "lastModifiedAt": "2014-03-01T18:55:25.000Z",
      "size": 136587
    },
    {
      "objectType": "application/cdmi-container",
      "objectId": "L29sZGVyX3N0dWZm",
      "objectName": "older_stuff",
      "parentID": "",
      "parentURI": "",
      "completionStatus": "Completed",
      "lastModifiedAt": "2012-04-26T22:19:15.000Z"
    }
  ]
}

Each object returned will have a few fields that are important:

Field Descritpion
objectType This will be one of the following:
application/cdmi-container
application/cdmi-object
objectId This is the ID of the object itself. NOTE: This is not always the native object ID. Some providers do not have a notion of object ID and in that case we generate an ID for it.
objectName The textual name of the object
parentID The object ID of the parent container object
parentURI The full URI for the parent object
size For objects of type application/cdmi-object this is the size of the object in bytes

When referring to objects you can use the full path to the object, or the object ID. For example to get the metadata for the "older_stuff" folder using the ID you would use the following call:

curl -X "GET" "https://test-api.intralinks.com/v1/il-storage/accounts/<ACCOUNT_ID>/objects/cdmi_objectId/L29sZGVyX3N0dWZm" \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
    -H "Content-Type: application/cdmi-object" \

Alternatively you can use the path to the object also:

curl -X "GET" "https://test-api.intralinks.com/v1/il-storage/accounts/<ACCOUNT_ID>/objects/older_stuff" \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
    -H "Content-Type: application/cdmi-object" \

Note, that the way you distinguish to the objects API which format you are using is with the additional API path of cdmi_objectid when you are using an ID, or just including the path when using the path to the object.

Additionally there are 2 different variations for the response object. The objects API supports an optional fields query parameter. This field takes 2 possible values:

  • metadata
    Some providers support additional meta data on objects beyond just the standard fields that CDMI supports.
  • children
    For container objects, this will cause the response to include a list of child objects within the container.

For example, to get a list of child folders in the 'older_stuff' folder you can add the fields=children query parameter to the previous call:

curl -X "GET" "https://test-api.intralinks.com/v1/il-storage/accounts/<ACCOUNT_ID>/objects/cdmi_objectId/L29sZGVyX3N0dWZm?fields=children" \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
    -H "Content-Type: application/cdmi-object" \

The new response looks like this:

{
  "objectType": "application/cdmi-container",
  "objectId": "L29sZGVyX3N0dWZm",
  "objectName": "older_stuff",
  "parentID": "",
  "parentURI": "",
  "completionStatus": "Completed",
  "lastModifiedAt": "2012-04-26T22:19:15.000Z"
  "children": [
    {
      "objectType": "application/cdmi-object",
      "objectId": "L29sZGVyX3N0dWZmL0FQSUZsb3cgVHV0b3JpYWwgMi5wZGY=",
      "objectName": "APIFlow Tutorial 2.pdf",
      "parentID": "L29sZGVyX3N0dWZm",
      "parentURI": "/older_stuff",
      "completionStatus": "Completed",
      "lastModifiedAt": "2016-07-20T14:19:19.000Z",
      "size": 136587
    }
  ]
}

 

API Reference:
GET Objects call

 

Uploading / Downloading

Navigating a hierarchy and finding a folder or file is pretty straightforward. The next step is uploading or downloading files. This too should be pretty straightforward once you are comfortable with the different HTTP headers you need to use.

 

Downloading

The first operation is to download a file. This is simply a matter of using the object id or the object path to the file and issuing a GET:

curl -X "GET" "https://test-api.intralinks.com/v1/il-storage/accounts/110148/objects/cdmi_objectId/L2FwaXRlc3QyL0FQSUZsb3cgVHV0b3JpYWwgMi5wZGY=" \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \

This API call will download the contents of the file. If you wish to retrieve just the metadata for the object, you can add the query parameter fields=metadata like this:

curl -X "GET" "https://test-api.intralinks.com/v1/il-storage/accounts/110148/objects/cdmi_objectId/L2FwaXRlc3QyL0FQSUZsb3cgVHV0b3JpYWwgMi5wZGY=?fields=metadata" \
    -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \

and you will recieve a JSON response

{
  "objectType": "application/cdmi-object",
  "objectId": "L2FwaWZsb3cgdHV0b3JpYWwgMi5wZGY=",
  "objectName": "apiflow tutorial 2.pdf",
  "parentID": "",
  "parentURI": "",
  "lastModifiedAt": "2016-01-08T15:46:07.000Z",
  "size": 218196
}

 

API Reference:
DataObjects

 

Uploading

To upload a file is just as simple. Step one is to determine where you want the file to go. You need an objectId or path for the destination and you can find that in one of the example calls above, or you can even create a new one. For the sake of illustration here, we can create a new folder to place the file.

In the example below we will create 2 folders. First we issue a POST to the path that we wish to create. In this case the first path is Demo Folder in the root of the provider. The second call will create a folder inside Demo folder called upload

curl -X "POST" "https://test-api.intralinks.com/v1/il-storage/accounts/18601401/objects/demo%20folder/" \
     -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
     -H "Content-Type: application/cdmi-container
curl -X "POST" "https://test-api.intralinks.com/v1/il-storage/accounts/18601401/objects/demo%20folder/upload" \
     -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
     -H "Content-Type: application/cdmi-container

In both calls it is important to include the Content-Type header set to application/cdmi-container. With out this header your call will fail.

In both cases the server will respond with a JSON object that details the metadata for the new folder.

{
  "objectType": "application/cdmi-container",
  "objectId": "L2RlbW8gZm9sZGVyL3VwbG9hZA==",
  "objectName": "upload",
  "parentID": "L2RlbW8gZm9sZGVy",
  "parentURI": "/demo folder",
  "completionStatus": "Completed",
  "lastModifiedAt": "2016-12-12T19:33:14.000Z"
}

Now that we have the destination folder were we want to place our upload, we can take the objectId or the full path for use in the next step. The next step will use objectId.

Now to upload the file. The format for the API call is very similar to the call that we used to create the folder. The API path will contain the parent folder id (or path) along with the name of the file that we want to create. This example will upload an image file called test.png to the folder we created above using the objectId:

curl -X "POST" "https://test-api.intralinks.com/v1/il-storage/accounts/18601401/cdmi_objectid/L2RlbW8gZm9sZGVyL3VwbG9hZA==/test.png" \
     -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
     -H "Content-Type: application/cdmi-object

The actual file data is provided in the body of the POST request.

Again, like the folder create API, it is important to ensure that the Content-Type header is set to application/cdmi-object so that the server understands what kind of data you are sending.

Again, assuming a successful upload, the API will respond with the metadata for the new file that was created:

{
  "objectType": "application/cdmi-object",
  "objectId": "L2RlbW8gZm9sZGVyL3VwbG9hZC90ZXN0LnBuZw==",
  "objectName": "test.png",
  "parentID": "L2RlbW8gZm9sZGVyL3VwbG9hZA==",
  "parentURI": "/demo folder/upload",
  "lastModifiedAt": "2016-12-12T19:40:11.000Z",
  "size": 1302833
}

 

API Reference:
Create DataObject