GoFAST : API REST

The GoFAST API REST allows developers to interact with the application programmatically. On this page you will find all the necessary information to operate the API.

Authentication

Basic

The Basic authentication method is the classic authentication method defined in RFC 7617 which is controlled by the HTTP protocol (also called HTTP authentication).

It requires passing the header Authorization to a request with the string Basic AUTHORIZATION_VALUE or AUTHORIZATION_VALUE which is the string of the username: password encoded with a base 64.

For example: For a user1: password1, you will have to pass the value: Basic dXNlcjE6bW90ZGVwYXNzZTE =

Token

The token authentication method is used to generate a temporary session identified by a token (a character string).

It uses the login resource, the token action and the GET method.

Caution

The token action is not available from the external GoFAST API, it is used between the internal components of the platform.

Resources

Resource: login

This resource allows you to interact with the GoFAST authentication system.

Action: token

This action allows you to interact with authentication system using a token.

Caution

The token action is not available from the external GoFAST API, it is used between the internal components of the platform.

GET

This method allows you to retrieve an authentication token. It is valid for 3 minutes.

GET: /api/login/token

Header Value
Content-Type application/json
GET Parameter Value
name* Username of the user

Feedback

Header Value
Content-Type application/json
Key Value
Token Authentication token

Resource: node

This resource allows you to interact with Drupal node type entities. They can represent documents, articles, spaces, forms…

Action: node

This action basically allows interacting with Drupal node type entities.

GET

This method allows to retrieve generic information from a node type entity

GET: /api/node/node

Header Value
Content-Type application/json
GET Parameter Value
nid* N° of the node

Feedback

Header Value
Content-Type application/json
Key Value
nid N° of the node
type Type of the node
title Title of the node
status 1: Published, 0: Unpublished (Deleted)
uid N° of the node creator
sticky 1: Pinned, 0: Not pinned
language Language of the node (fr, en, nl, und…)
created Timestamp of the node creation
updated Timestamp of the last node modification
update_uid N° of the last node modification
comment_count Number of comments attached to the node
last_comment_uid N° of the last node commentator
last_comment_timestamp Timestamp of the last node comment
last_comment_cid N° of the last node comment
alfresco_reference Alfresco content reference associated with the node
POST

This method allows creating a node type entity. If this node is of type alfresco_item and it is not created from a template, it is required to add a file.

POST: /api/node/node

Header Value
Content-Type multipart/form-data
Key Value
file** The file to upload (if the node type is “alfresco_item” and it is not to be created from a template)
Header Value
Content-Type application/json
Key Value
type* Type of the node
title* The title of the file, the article, the forum …
locations** The locations in an array, for example “/ Sites / _Organizations / My Organization / XXX” (alfresco_item only)
template_nid** The identifier of the template node from which to create the file if necessary (alfresco_item only)
gids** The n° of target spaces in an array (article, forum only)
body** Content in HTML format (article, forum only)
The available node types are:
  • alfresco_item (Document)
  • article (Internal page)
  • forum (Forum)

Feedback

Header Value
Content-Type application/json
Key Value
nid N° of the node

Action: metadata

This action allows interacting with the metadata associated with node type entities

GET

This method helps you to retrieve the metadata associated with node type entities

GET: /api/node/metadata

Header Value
Content-Type application/json
GET Parameter Value
nid* N° of the node

Feedback

Header Value
Content-Type application/json
Key Value
field_XXX Array containing the field values
field_YYY Array containing the field values
POST

This method allows updating the metadata associated with node type entities

POST: /api/node/metadata

Header Value
Content-Type application/json

Note

Unlike the feedback of the GET method, the values should not be listed in this way
field_XXX : Array
0: value: Array
VAL1
1: value: Array
VAL2
But it is possible like this
field_XXX : Array
0: VAL1, 1: VAL2
Or like that depending on the modified field
field_XXX : VAL

The modifiable fields are : field_category, field_state, field_target_link, field_external_page_url, field_date, field_criticity, field_document_author, field_tags

Key Value
nid* N° of the node
field_XXX Array containing the field values
field_YYY Array containing the field values

Feedback

Header Value
Content-Type application/json
Key Value
Field_XXX Array containing the return of the function
Field_YYY Array containing the return of the function
PATCH

This method allows you to add a value to certain metadata associated with node type entities

PATCH: /api/node/metadata

Header Value
Content-Type application/json

Note

Unlike the feedback of the GET method, the values should not be listed in this way
field_XXX : Array
0: value: Array
VAL1
1: value: Array
VAL2
But it is possible like this
field_XXX : Array
0: VAL1, 1: VAL2
Or like that depending on the modified field
field_XXX : VAL

The alterable fields are : field_target_link, field_external_page_url, field_tags

Key Value
nid* N° of the node
field_XXX Array containing the field values
field_YYY Array containing the field values

Feedback

Header Value
Content-Type application/json
Key Value
Field_XXX Array containing the return of the function
Field_YYY Array containing the return of the function

Action : locations

This action allows you to interact with the locations of the content associated with node type entities

GET

This method allows to retrieve the locations of the content associated with node type entities

GET: /api/node/locations

Header Value
Content-Type application/json
GET Parameter Value
nid* N° of the node

Feedback

Header Value
Content-Type application/json
Key Value
locations Indexed array containing locations.
PUT

This method allows you to modify the locations of the content associated with node type entities

PUT: /api/node/locations

Header Value
Content-Type application/json
POST Parameter | Value
nid* N° of the node
locations* Indexed array containing locations

Feedback

Header Value
Content-Type application/json
Key Value
locations Indexed array containing the locations after the cache has been emptied.
POST

This method allows you to add or delete locations of the content associated with node type entities

POST: /api/node/locations

Header Value
Content-Type application/json
POST Parameter | Value
nid* N° of the node
locations* Indexed array containing the new locations to add

Feedback

Header Value
Content-Type application/json
Key Value
locations Indexed array containing the locations after the cache has been emptied.
delete Boolean 1 = delete; 0 = add.

Action : content

This action allows interacting with Alfresco content associated with node type entities

Caution

Using this action on a node without association with Alfresco content will result in a “404 Not Found” error. The nodes associated with Alfresco content are of type “alfresco_item”.

GET

This method allows to retrieve the Alfresco content associated with a node.

GET: /api/node/content

Header Value
Content-Type application/octet-stream
Content-Disposition attachment
GET Parameter Value
nid* N° of the node

Feedback

Header Value
Content-Type application/octet-stream
Content-Disposition attachment; filename=”file_name”

The request content reply is the document content.

POST

This method allows you to replace the Alfresco content associated with a node by creating a new version.

POST: /api/node/content

Header Value
Content-Type multipart/form-data
POST Parameter Value
file The file to upload
Header Value
Content-Type application/json
Key Value
nid* N° of the node
comment Comment associated with the new version
major_version 0: Minor version, 1: Major version (default: 0)

Feedback

Header Value
Content-Type application/json
Key Value
success 1: OK, 0: Error

Action: preview

This action allows you to interact with PDF previews linked to node type entities

Caution

Using this action on a node without association with Alfresco content will result in a “404 Not Found” error. The nodes associated with Alfresco content are of type “alfresco_item”.

GET

This method allows you to retrieve the PDF preview of Alfresco content linked to a node.

GET: /api/node/preview

Header Value
Content-Type application/pdf
Content-Disposition attachment
GET Parameter Value
nid* N° of the node

Feedback

Header Value
Content-Type application/pdf
Content-Disposition attachment; filename=”file_name”

The request content reply is the content of the document PDF preview.

Action : version

This action allows you to interact with the versions of Alfresco content associated with node type entities

GET

This method makes it possible to retrieve the versions of Alfresco content linked to a node type entity

GET: /api/node/version

Header Value
Content-Type application/json
GET Parameter Value
nid* N° of the node

Feedback

Header Value
Content-Type application/json
Key Value
creator Version creator identifier
type MINOR: Minor version, MAJOR: Major version
created Timestamp of the version creation
version N° of version
comment Comment linked to the version

Action : autocomplete

This action enables to interact with the autocompletion system of the Drupal node entity.

GET

This method enables to retrieve a list of nodes based on the last string in input and requested bundles.

GET: /api/node/autocomplete

Header Value
Content-Type application/json
Key Value
str* Input
bundles Comma-separated list of bundles (alfresco_item par default)

Feedback

Header Value
Content-Type application/json
Key Value
uid Some basic user information

Resource : comment

This resource helps you to interact with Drupal comment-type entities. They represent comments associated with node type entities

Action : comment

This action allows you to interact basically with Drupal comment - type entities.

GET

This method allows to retrieve a comment

GET: /api/comment/comment

Header Value
Content-Type application/json
GET Parameter Value
cid* N° of a comment

Feedback

Header Value
Content-Type application/json
Key Value
nid N° of the node
cid N° of a comment
uid N ° of the user who commented
subject Title of the comment
body content of the comment
is_private 0: Public comment, 1: Private comment
PUT

This method allows to attach a comment to a node type entity

GET: /api/comment/comment

Header Value
Content-Type application/json
Key Value
nid* N° of the node
subject* Title of the comment
body* Content of the comment (HTML format)
is_private 0: Public comment, 1: Private comment (default: 0)

Feedback

Header Value
Content-Type application/json
Key Value
cid N° of a comment

Resource : space

Cette ressource permet d’intéragir avec les Organic Groups de Drupal de type comment. Ces derniers représentent ce que l’on appelle des espaces collaboratifs

Action : space

Cette action permet d’intéragir basiquement avec les Organic Groups de Drupal.

PUT

This method allows you to create a collaborative space through the Drupal mechanism

PUT: /api/space/space

Header Value
Content-Type application/json
Key Value
gid* N° of the parent space node
title* Title of the new space
body Content of the space homepage (HTML format)

Feedback

Header Value
Content-Type application/json
Key Value
gid N° of the created space

Resource : taxonomy

This resource helps to interact with Drupal taxonomy. The taxonomy allows to associate terms with a content (for example: category, importance…)

Action : terms

This action helps to interact with the terms of the Drupal taxonomy.

GET

This method makes it possible to retrieve taxonomy terms associated with a vocabulary

Note

The available vocabulary_name values can be retrieved from the vocabularies action. Example of possible values: category, criticity, tags

GET: /api/taxonomy/terms

Header Value
Content-Type application/json
Key Value
vocabulary_name* Vocabulary name

Feedback

Header Value
Content-Type application/json
Key Value
term_name Array containing the term ID and some informations

Action : vocabularies

This action helps to interact with the vocabularies of the Drupal taxonomy.

GET

This method makes it possible to retrieve the vocabularies of the Drupal taxonomy

GET: /api/taxonomy/vocabularies

Feedback

Header Value
Content-Type application/json
Key Value
vocabulary_name Array containing the vocabulary ID and some information

Resource : user

This resource makes it possible to interact with the Drupal user entities . These entities represent the users registered on the platform.

Action : autocomplete

This action allows you to interact with an autocompletion system of Drupal user entities.

GET

This method allows to get a list of users according to the input string.

GET: /api/user/autocomplete

Header Value
Content-Type application/json
Key Value
str* Input

Feedback

Header Value
Content-Type application/json
Key Value
uid Some basic user information

Resource : locations

This resource makes it possible to interact with the available locations on Alfresco (all the files and spaces from a DMS point of view only)

Action : tree

This action helps to recover a tree of locations in JSON format compatible with the ZTree component.

POST

This method makes it possible to recover a tree of locations in JSON format compatible with the ZTree component.

GET: /api/locations/tree

Header Value
Content-Type application/json
Key Value
ename Path from which to retrieve the children

Feedback

Header Value
Content-Type application/json
Key Value
tree JSON format string is directly usable by the ZTree library