The FileBound Web API let's you create and update data with your FileBound system in a REST-ful manner. Requests and Responses are formatted using JSON. This guide has built-in, working samples that you can play with and test yourself - all the jQuery examples on the right side are fully editable, so you can manipulate the requests to target the data you want.
Each request to the FileBound Web API needs to include an authentication GUID, which is provided by the Login endpoint. The next section, Authentication, shows this in detail. Permissions associated with the user who logs in will be applied to any request that contains their GUID.
This guide has built-in, editable examples that you can test and use yourself!
DISCLAIMER: Requests ran in this guide are ran against your live site, so edit and delete data at your own risk!
To use the interactive examples, you first need to click Try it! on one of the authentication examples so the page can store an authentication GUID. Once you've logged in successfully, that GUID will be used in any subsequent example - we add the GUID to the request for you, so they are not required in the examples you run.
Adding Content
Want to add a new file or document? Check out the Empty endpoint. Here you can specify whichever object you want, such as file, for the template property. You can use this to get a blank object with default values specified. Here's how you can get an empty group object - no authentication required on this endpoint.
Each request to the FileBound REST API must be authenticated using either a Basic Authentication Authorization header, or by providing an authentication GUID in the guid parameter on the querystring.
Note: An authentication GUID is valid for 24 hours. After that, any request to the API which requires authentication will fail with that GUID and you will get a generic "Login Error" message. If you receive this message, you'll need to re-authenticate to get a new GUID.
Basic Authentication
To use Basic Authentication, you must send an Authorization header specifying basic authentication and providing a base-64 encoded username:password string.
Request Headers
Authorization
string with "Basic " + base-64 encoded username password in the format of username:password Ex) Authorization: "Basic YWRtaW46YWRtaW4="
Username/Password Authentication
To get a Login GUID using Username/password Authentication, you must send a POST request to api/login containing a JSON-formatted object with the username and password of the user you wish to authenticate as. You must also specify application/json as the content-type header.
Request Headers
Content-Type
must be application/json Ex) Content-Type: "application/json"
Your URL:
http://support.filebound.com/api/login
Basic Auth Example
It should be noted here that it is not necessary to make a login request with Basic Authentication. This example is just to demonstrate an example of including the Basic Auth header in a request. Requests authenticated with Basic Authentication do not need a GUID, just the Basic Auth header.
The syntax to add a custom filter to a request is simple. Let's look at a request which will retrieve all documents:
[GET] api/documents
But what if you only want Documents that exist in a divider called Applications? For this we must add a custom filter. The custom filter syntax is:
&filter=property1_value1,property2_value2,...
As you can see, the underscore means equals and the commas separate the list of properties to filter on. So if we look at the Document Filter below, we can see there is a divider property. So, a request filtering on the divider property woud look like:
[GET] api/documents?filter=divider_Applications
Now only documents that exist in the Applications divider will be returned. But what if you also want to specify which separator houses the documents? Easy - just add the separator property onto the current filter:
Some object properties are enumeration types. When you request a file from the API and you see the status property has a value of 1, it may be unclear what that means. Server-side, a file's status property is an enumeration, so the value you get back from the API is the numerical representation of that enumeration. Looking at the file object you can see that the status property is of type FileStatus. Navigating to that property shows that 1 means Active. You can see the full enum reference here.
Adds a new document, or updates an existing document if documentid is not 0, with the binary data from the body of the request.
If documentId is not 0, fileid is not required and the binary data and extension of the associated document will be updated with the data provided.
If documentId is 0, then fileid is required and a new document will be created within that file using the binary data and extension provided.
Upload a new document to the indexing queue.
The binary data from the body of the request is used to create a document in the indexing queue. The extension parameter is required. The projectId parameter is optional, and can be used to assign to a specific project
Updates eformdetail based on the documentid provided. The eformdetail will be matched on the fieldName property, non-matches will be added as new entries.
Returns a routeditem for the specified routeditemid. If localtreeonly is true, a collection of routed items will be returned for routed items in the local tree, starting with this routeditemid.
Returns styled and functional buttons (as html) for a given assignment. Includes the required javascript but you can specify whether or not jquery/jquery ui get included as well.
When searching by a value that contains a space, for example searching for a project named 'Project ABC', you may receive a 404 if you manually URL-encode the spaces to send Project%20ABC. To resolve this, remove the manual URL-encoding and send the request with spaces.
If you receive this error, double check that the user you're authenticating with (the user you logged in with for the authentication GUID) has access to the particular project/file/document. For documents and files, the user will need access to the parent project as well.
If the value you are attempting to filter on contains a comma, you must include an escape character or the filter will be truncated after the comma. To prevent this, use a "\" character in the filter. For example, if you are filtering for "Red, White, and Blue"; use "Red\, White\, and Blue".