AIM API

AIM Modeller provides a REST API that you can use to do many things, incl. query the model, update the model, and create stories.

The Tech Demo contain Ruby script which shows how to call the REST API to do useful things.

Following is the list of REST API calls.

GET /stories

Get all stories

Response body: JSON for all stories. Header only.

 

GET /functions

Get all functions

Response body: JSON for all functions

 

GET /story/{story_id}/widgets

Get all widgets for a given story

Response body: JSON for all widgets for a given story.

 

POST /story/{story_id}/widgets

Add a story widget to a story

Request body:

{

  “type” : “Text”, 

  “text” : “The text you want to add as a widget”

}

 

PUT /story/banner

Set some text in the top centre position in AIM

Request body:

{

  “rich_text” : “Your rich text”,

  “reading_time” : number of seconds

}

The rich text can be any text format that Unity understands as per Rich Text | Unity UI | 1.0.0 (unity3d.com). The most common mark up to use in rich text is <b></b> for bold, <i></i> for italic, and <color=blue></color> for text color changes.

 

PUT /camera/target

Move the camera to look at the specified model element

Request body.

{

  “name” : name of model element for camera to move to

}

 

POST /stories

Create a new story

Request body:

{

  “name” : “Your story name”

}

Response header:

Location: /story/{story_id}            Location URI of the new story created.

 

GET /story/{story_id}

Get the specified story

Response body: JSON for the specified story

 

POST /story/{story_id}/commands

Execute a command against the specified story.

 

This command will play the specified story

{

  “story_id” : your story id

  “cmd” : “play”

}

 

POST /components

Create a new component, which will appear in the model in AIM

{

  “name” : “Your new component name”

}

 

Response header:

Location: /component/{component_id}     URI for the new component created

 

POST /component/{component_id}/functions

Create a new function in the specified component, and show it in the AIM model

Request body:

{

  “name” : “Your new function name”

}

Response header:

Location: /function/{function_id}          URI of the function just created

 

GET /model/layout

Get all layout information for all elements in the model.

Response body: All model elements and their co-ordinates

 

GET /function/{function_id}

Get the specified function by id

Response body: JSON for function

 

GET /functions?name={function_name}

Get the specified function by name

Response body: JSON for function

 

GET /information

Get all information in the model

Response body: JSON for all model information

 

GET /functions?<query_string>

Get all functions that meet the specified filter.

where query_string can be composed of any combination of the following

  • name={name}
  • information_in={information1},{information2}
  • information_out={information1},{information2}
  • {property}={value} – any number of property key/value pairs

Examples.

GET /functions?name=Place Order

GET /functions?information_in=Order,Invoice

GET /functions?information_out=Invoice

GET /functions?Domain=Ordering

GET /functions?Domain=Ordering&information_out=Order

 

GET /components?name={component_name}

Get the specified component by name

Response body: JSON for component

 

GET /components

Get all components

Response body: JSON for all components