WebServices API - visual-planning.com · Access to these WebServices is protected by an API key....

59
WebServices API STILOG IST, all rights reserved

Transcript of WebServices API - visual-planning.com · Access to these WebServices is protected by an API key....

Page 1: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

STILOG IST, all rights reserved

Page 2: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

STILOG IST, all rights reserved 2

Page 3: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Table of ContentsI. Introduction ..................................................................................................................................... 1

1. Generating an API Key ............................................................................................................ 1II. SOAP WebService ......................................................................................................................... 3

1. Definition ................................................................................................................................... 32. List of operations ...................................................................................................................... 33. exportEvents ............................................................................................................................. 3

Query ..................................................................................................................................... 4Response ............................................................................................................................... 4Data types ............................................................................................................................. 4

4. getEvents .................................................................................................................................. 4Query ..................................................................................................................................... 4Response ............................................................................................................................... 5Data types ............................................................................................................................. 5

5. importEvent ............................................................................................................................... 6Query ..................................................................................................................................... 6Response ............................................................................................................................... 6Data types ............................................................................................................................. 7

6. addEvent ................................................................................................................................... 7Query ..................................................................................................................................... 7Response ............................................................................................................................... 8Data types ............................................................................................................................. 8

7. modifyEvent .............................................................................................................................. 9Query ..................................................................................................................................... 9Response ............................................................................................................................... 9Data types ........................................................................................................................... 10

8. deleteEvent ............................................................................................................................. 10Query ................................................................................................................................... 10Response ............................................................................................................................. 11Data type ............................................................................................................................. 11

9. exportResources ..................................................................................................................... 12Query ................................................................................................................................... 12Response ............................................................................................................................. 12Data types ........................................................................................................................... 12

10. getResources ........................................................................................................................ 13Query ................................................................................................................................... 13Response ............................................................................................................................. 13Data types ........................................................................................................................... 14

11. importResource ..................................................................................................................... 14Query ................................................................................................................................... 14Response ............................................................................................................................. 14Data types ........................................................................................................................... 15

12. addResource ........................................................................................................................ 15

STILOG IST, all rights reserved iii

Page 4: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Query ................................................................................................................................... 15Response ............................................................................................................................. 16Data types ........................................................................................................................... 16

13. modifyResource .................................................................................................................... 17Query ................................................................................................................................... 17Response ............................................................................................................................. 18Data types ........................................................................................................................... 18

14. deleteResource ..................................................................................................................... 19Query ................................................................................................................................... 19Response ............................................................................................................................. 19Data types ........................................................................................................................... 20

15. addEventLink ........................................................................................................................ 20Query ................................................................................................................................... 20Response ............................................................................................................................. 21Data type ............................................................................................................................. 22

16. deleteEventLink .................................................................................................................... 22Query ................................................................................................................................... 22Response ............................................................................................................................. 23Data type ............................................................................................................................. 23

III. REST WebService ....................................................................................................................... 241. Introduction ............................................................................................................................. 242. List of access points .............................................................................................................. 243. /attributes ................................................................................................................................ 25

Query ................................................................................................................................... 25Response ............................................................................................................................. 25Example: .............................................................................................................................. 25

4. /event/export ........................................................................................................................... 26Query ................................................................................................................................... 26Response ............................................................................................................................. 27Example: .............................................................................................................................. 28

5. /event/get ................................................................................................................................ 29Query ................................................................................................................................... 29Response ............................................................................................................................. 30Example: .............................................................................................................................. 30

6. /event/add ............................................................................................................................... 32Query ................................................................................................................................... 32Response ............................................................................................................................. 33Example 1: ........................................................................................................................... 33Example 2: ........................................................................................................................... 34

7. /event/modify ........................................................................................................................... 35Query ................................................................................................................................... 35Response ............................................................................................................................. 36Example: .............................................................................................................................. 36

8. /event/delete ............................................................................................................................ 37

STILOG IST, all rights reserved iv

Page 5: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Query ................................................................................................................................... 37Response ............................................................................................................................. 38Example: .............................................................................................................................. 38

9. /resource/export ...................................................................................................................... 38Query ................................................................................................................................... 38Response ............................................................................................................................. 39Example: .............................................................................................................................. 40

10. /resource/get ......................................................................................................................... 41Query ................................................................................................................................... 41Response ............................................................................................................................. 42Example: .............................................................................................................................. 43

11. /resource/add ........................................................................................................................ 45Query ................................................................................................................................... 45Response ............................................................................................................................. 45Example: .............................................................................................................................. 46

12. /resource/modify .................................................................................................................... 46Query ................................................................................................................................... 47Response ............................................................................................................................. 47Example: .............................................................................................................................. 48

13. /resource/delete .................................................................................................................... 49Query ................................................................................................................................... 49Response ............................................................................................................................. 49Example: .............................................................................................................................. 49

14. /link/create ............................................................................................................................. 50Query ................................................................................................................................... 50Response ............................................................................................................................. 51Example: .............................................................................................................................. 52

15. /link/delete ............................................................................................................................. 52Query ................................................................................................................................... 52Response ............................................................................................................................. 53Example: .............................................................................................................................. 53

STILOG IST, all rights reserved v

Page 6: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Chapter I. IntroductionIt is now possible to interact with certain entities of Visual Planning from third party applications thanksto the possibilities offered by the WebServices of the SOAP or REST implementations.

These WebServices provide functionalities to read/create/edit/delete events and resources. They canalso be used to create and delete links between events.

Throughout this document, ROOTVP refers to the root of the URL that provides access to the VisualPlanning server in question (i.e. before /index.jsp in the URL used to access the home page of theVP server).

Access to these WebServices is protected by an API key. This key is dedicated to one user who mustbe explicitly declared in the AdminCenter as having the rights to use these services. The declarationof the user and the creation of the API key are specific to each planner.

1. Generating an API KeyTo generate an API Key, start the Admin Center, then edit the properties of a planner using the « Modify »option in its contextual menu in order to display the edition window for the planner properties.

In the “WebService” heading of the edition panel for planner properties, click on the Edit button of thefield “Authorized users”.

Add a User using the dedicated button (for instance “user1”). The API Key is automatically generatedas follows:

STILOG IST, all rights reserved 1

Page 7: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Click OK to confirm that the new user is added. Then, click on Validate in the edition panel for plannerproperties in order to save changes made.

STILOG IST, all rights reserved 2

Page 8: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Chapter II. SOAP WebService

1. DefinitionThis WebService can be accessed from the URL ROOTVP/ws/soap.

The URL ROOTVP/ws/soap?wsdl can be used to obtain the corresponding wsdl.

All the points of access to this WebService must define the apikey attribute with the value provided bythe AdminCenter for the corresponding user and planner.

2. List of operations

Name Description Output

exportEvents Provides the characteristics of an event by an event exportcontext.

EntityInfo[][]

getEvents Provides the characteristics of a set of events. EntityInfo[][]

importEvent Creates a new event by an event import context. WSResult

addEvent Creates a new event. WSResult

modifyEvent Edits the characteristics of an event. WSResult

deleteEvent Deletes an event. WSResult

exportResourcesProvides the characteristics of a resource by a resource exportcontext.

EntityInfo[][]

getResources Provides the characteristics of a set of resources. EntityInfo[][]

importResourceCreates a new resource by a resource import context. WSResult

addResource Creates a new resource.

modifyResourceEdits the characteristics of a resource. WSResult

deleteResource Deletes a resource. WSResult

addEventLink Creates a link between two events. WSResult

deleteEventLinkDeletes a link between two events. WSResult

3. exportEventsInitializes an existing event export context in the planner and retrieves the data it outputs.

STILOG IST, all rights reserved 3

Page 9: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Query

Parameter Type

apikey String

exportUID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

exportUID

UID identifier of the initialized event export context in the form of a character string.

Response

Attribute Type

exportEventsResponse EntityInfo[][]

exportEventsresponse

In the event of an error the response is null.

In the event of success, the response is an EntityInfo structure table.

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

4. getEventsRetrieves the characteristics of a set of events matching a filter in the planner in question.

Query

Parameter Type

STILOG IST, all rights reserved 4

Page 10: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

apikey String

attributes String []

filterName String

extraInfos EntityInfo[]

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

The attributes to be retrieved.

filterName

Name of the applied events filter.

extraInfos [optional]

Dynamic attributes of the filter

Response

Attribute Type

getEventsResponse EntityInfo[][]

getEventsResponse

In the event of an error the response is null.

In the event of success, the response is an EntityInfo structure table.

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

STILOG IST, all rights reserved 5

Page 11: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

5. importEventCreates a new event by an event import context.

Query

Parameter Type

apikey String

attributes EntityInfo []

importUID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

List of the attributes used to create the event.

importUID

Internal identifier of the event import context to be initialized.

Response

Attribute Type

importEventResponse WSResult

importEventResponse

The response is made up of a WSResult structure containing an error code (error), and the associatedmessage (message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0

1 Invalid session: apikey

STILOG IST, all rights reserved 6

Page 12: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

2 No import context: importUID

Invalid import context : importUID

Error create temporary file

3 Import KO

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

message String Error message

6. addEventCreates a new event.

Query

Parameter Type

apikey String

attributes EntityInfo []

parentKey EntityInfo []

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

STILOG IST, all rights reserved 7

Page 13: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

List of the attributes used to create the event.

parentKey [optional]

List of the identification attributes of the parent event.

Response

Attribute Type

addEventResponse WSResult

addEventResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0 UID of the event

1 Invalid session: apikey

2 Invalid attribute: entityName

3 Create KO

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

STILOG IST, all rights reserved 8

Page 14: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

message String Error message

7. modifyEventEdits the characteristics of an event.

Query

Parameter Type

apikey String

attributes EntityInfo []

keys EntityInfo []

parentKeys EntityInfo []

forceCreate boolean

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

List of the attributes to be edited.

keys

List of the identification attributes of the event.

parentKeys [optional]

List of the identification attributes of the parent event.

forceCreate

Option to force the creation of the event.

Accepts the values true or false. If the value is true, an event is created if no matching key exists inthe planner.

Response

Attribute Type

STILOG IST, all rights reserved 9

Page 15: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

modifyEventResponse WSResult

modifyEventResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0

1 Invalid session: apikey

2 Invalid attribute: entityName

3 Update KO

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

message String Error message

8. deleteEventDeletes an event from a planner.

Query

Parameter Type

STILOG IST, all rights reserved 10

Page 16: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

apikey String

UID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

UID

UID identifier of the event.

Response

Attribute Type

deleteEventResponse WSResult

deleteEventResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0

1 Invalid session: apikey

2 No event for: UID

3 Delete KO

Data type

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

STILOG IST, all rights reserved 11

Page 17: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

message String Error message

9. exportResourcesInitializes an existing resource export context in the planner and retrieves the data it outputs.

Query

Parameter Type

apikey String

exportUID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

exportUID

Internal identifier of the resource export context to be initialized.

Response

Attribute Type

exportResourcesResponse EntityInfo[][]

exportResourcesResponse

In the event of an error the response is null.

In the event of success, the response is an EntityInfo structure table.

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

STILOG IST, all rights reserved 12

Page 18: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

10. getResourcesRetrieves the characteristics of a set of resources matching a filter in the planner in question.

Query

Parameter Type

apikey String

resourceModel String

attributes String []

filterName String

extraInfos EntityInfo[]

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

resourceModel

Name of the dimension

attributes

The attributes to be retrieved.

filterName

Name of the applied resource filter.

extraInfos [optional]

Dynamic attributes of the filter

Response

Attribute Type

getResourcesResponse EntityInfo[][]

getResourcesResponse

In the event of an error the response is null.

STILOG IST, all rights reserved 13

Page 19: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

In the event of success, the response is an EntityInfo structure table.

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

11. importResourceCreates a new event by a resource import context.

Query

Parameter Type

apikey String

attributes EntityInfo []

importUID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

List of the attributes used to create the event.

importUID

Internal identifier of the resource import context to be initialized.

Response

Attribute Type

importResourceResponse WSResult

importResourceResponse

STILOG IST, all rights reserved 14

Page 20: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0

1 Invalid session : apikey

2 No import context : importUID

Invalid import context : importUID

Error create temporary file

3 Import KO

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

message String Error message

12. addResourceCreates a new resource.

Query

Parameter Type

STILOG IST, all rights reserved 15

Page 21: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

apikey String

resourceModel String

attributes EntityInfo []

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

resourceModel

Name of the dimension

attributes

List of the attributes used to create the event.

Response

Attribute Type

addResourceResponse WSResult

addResourceResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0 UID of the resource

1 Invalid session : apikey

2 Invalid attribute : entityName

3 Create KO

Data types

The EntityInfo structure is made up of the following two fields:

STILOG IST, all rights reserved 16

Page 22: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Field Type Description

entityName String Attribute name

entityValue String Attribute value

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

message String Error message

13. modifyResourceEdits the characteristics of a resource.

Query

Parameter Type

apikey String

resourceModel String

attributes EntityInfo []

keys EntityInfo []

forceCreate boolean

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

resourceModel

Name of the dimension.

Attributes

List of the attributes to be edited.

keys

List of the identification attributes of the resource.

STILOG IST, all rights reserved 17

Page 23: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

forceCreate

Option to force the creation of the resource.

Accepts the values true or false. If the value is true, a resource is created if no matching key existsin the planner.

Response

Attribute Type

modifyResourceResponse WSResult

modifyResourceResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0

1 Invalid session : apikey

2 Invalid attribute : entityName

3 Update KO

Data types

The EntityInfo structure is made up of the following two fields:

Field Type Description

entityName String Attribute name

entityValue String Attribute value

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

STILOG IST, all rights reserved 18

Page 24: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

message String Error message

14. deleteResourceDeletes a resource from a planner.

Query

Parameter Type

apikey String

resourceModel String

UID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

resourceModel

Name of the dimension

UID

Unique UID identifier of the resource.

Response

Attribute Type

deleteResourceResponse WSResult

deleteResourceResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

STILOG IST, all rights reserved 19

Page 25: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

0

1 Invalid session : apikey

2 No eventResource for : UID

3 Delete KO

Data types

The WSResult structure is made up of the following two fields:

Field Type Description

error int Code erreur

message String Message d’erreur

15. addEventLinkCreates a link between two events.

Query

Parameter Type

apikey String

beginUID String

endUID String

type String

behavior String

mode String

delayType String

delay int

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

beginUID

STILOG IST, all rights reserved 20

Page 26: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

UID identifier of the start event.

endUID

UID identifier of the end event.

type

Type of link (End to start, Start to start, End to end, Start to end)« END_BEGIN »,« BEGIN_BEGIN »,« END_END »,« BEGIN_END ».

behavior

Behavior of the link (Adjust, Warning, Constraint) « ADJUST »,« WARNING »,« CONSTRAINT ».

mode

Link mode (Strict delay, Maximum delay, Minimum delay)« STRICT »,« ADJUSTMIN »,« ADJUSTMAX ».

delayType

Delay type (Hourly, Daily) « DAY »,« HOUR ».

delay

Delay between the start event and the end event (in minutes or in days)

Response

Attribute Type

addEventLinkResponse WSResult

addEventLinkResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0

1 Invalid session: apikey

STILOG IST, all rights reserved 21

Page 27: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

2 Begin event must be different of the end event

3 Invalid begin or end event UID

Link already exists

4 Invalid link type : type

5 Invalid link mode : mode

6 Invalid delay type : delayType

7 Invalid link behavior : behavior

8 Create KO

Data type

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

message String Error message

16. deleteEventLinkDeletes a link between two events.

Query

Parameter Type

apikey String

beginUID String

endUID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

beginUID

UID identifier of the begin event.

STILOG IST, all rights reserved 22

Page 28: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

endUID

UID identifier of the end event.

Response

Attribute Type

deleteEventLinkResponse WSResult

deleteEventLinkResponse

The response is made up of a WSResult structure containing an “error” field (error code) and a“message” field (associated message).

In the event of a success, the error code is 0.

In the event of a failure, the error code is >0 and the message indicates the nature of the errorencountered.

error message

0

1 Invalid session: apikey

2 Begin event must be different of the end event

3 Invalid begin or end event UID

4 Delete KO

Data type

The WSResult structure is made up of the following two fields:

Field Type Description

error int Error code

message String Error message

STILOG IST, all rights reserved 23

Page 29: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Chapter III. REST WebService

1. IntroductionThis WebService can be accessed from the URL ROOTVP/ws/rest.

All the points of access to this WebService must define the apikey attribute with the value provided bythe AdminCenter for the corresponding user.

For example, to retrieve the list of the labels of the available attributes, the form of the URL is therefore:

ROOTVP/ws/rest/attributes ?apikey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Where xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is the key provided.

For all other points of access, the apikey attribute is applied as a parameter of the header of the queryand is therefore not specified on the line of the URL.

Example in Java code:

HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();

connection.setRequestProperty ("apikey", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");

All the exchanges, inputs and outputs of the API are coded in UTF-8.

2. List of access points

Method EndPoint Use Output

GET /ws/rest/attributes Gets the labels of the available attributes. String

GET /ws/rest/event/export Provides the characteristics of an event by an eventexport context.

EntityInfoResult

POST /ws/rest/event/get Provides the characteristics of a set of events. EntityInfoResult

POST /ws/rest/event/add Creates a new event. WSResult

PUT /ws/rest/event/modify Edits the characteristics of an event. WSResult

DELETE /ws/rest/event/delete Deletes an event. WSResult

GET /ws/rest/resource/export

Provides the characteristics of a resource by aresource export context.

EntityInfoResult

POST /ws/rest/resource/get Provides the characteristics of a set of resources. EntityInfoResult

POST /ws/rest/resource/add Creates a new resource. WSResult

STILOG IST, all rights reserved 24

Page 30: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

PUT /ws/rest/resource/modify

Edits the characteristics of a resource. WSResult

DELETE /ws/rest/resource/delete

Deletes a resource. WSResult

POST /ws/rest/link/create Creates a link between two events. WSResult

DELETE /ws/rest/link/delete Deletes a link between two events. WSResult

3. /attributesDepending on the planner in question, provides the list of available attributes for the different pointsof access of the REST API.

Query

Method URL

GET RACINEVP/ws/rest/attributes

Type Parameters Values

QUERY apikey String

apikey

Must be sent in all the queries.

Response

In the event of a success, the response is a table of character strings containing the various labels ofthe available attributes. These identical labels are to be used when calling the other points of accessof the REST API.

If the apikey provided is not valid, the response is null.

Example:

For the “REST API DEMO”, installed on a Visual Planning server with the root http ://127.0.0.1:8906/ip50 and with a user with the following API access key: d9f79618-59e4-a710-8203-a39bab9ad09b.

URL:

http://127.0.0.1:8906/ip50/ws/rest/attributes?apikey=d9f79618-59e4a710-8203-a39bab9ad09b

Response:

STILOG IST, all rights reserved 25

Page 31: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

["Evénement-Date de début","Evénement-Date de fin","Evénement-Jour de début","Evénement-Jourde fin","Evénement-Heure de début","Evénement-Heure de fin","Evénement-Durée","Evénement-Charge","Evénement-Réalisation","Evénement-Note","Evénement-Durée en Heures","Evénement-Durée en Jours","Evénement-Type de l'événement","Evénement-Type de la charge","Evénement-Charge en heures","Evénement-Charge en jours","Evénement-Travaillé","Evénement-Réalisationautomatique","Evénement-Etat","Evénement-Contraintes non vérifiées","Evénement-Identifiant interne(UID)","Parent Evénement-Date de début","Parent Evénement-Date de fin","ParentEvénement-Jour de début","Parent Evénement-Jour de fin","Parent Evénement-Heure dedébut","Parent Evénement-Heure de fin","Parent Evénement-Durée","Parent Evénement-Charge","Parent Evénement-Réalisation","Parent Evénement-Note","Parent Evénement-Type del'événement","Parent Evénement-Type de la charge","Parent Evénement-Travaillé","ParentEvénement-Réalisation automatique","Parent Evénement-Durée en Heures","Parent Evénement-Durée en Jours","Parent Evénement-Charge en jours","Parent Evénement-Charge enheures","Parent Historique-Créé le","Parent Historique-Modifié le","Parent Historique-Créépar","Parent Historique-Modifié par","Parent Evénement-Identifiant interne (UID)","ParentPoste 2-Valeur fixe","Parent Poste 2-Valeur par unité","Parent Poste 2-Coefficient","ParentPoste 2-Total","Parent Poste 2-Total (Euros)","Parent Prix vendu-Valeur fixe","ParentPrix vendu-Valeur par unité","Parent Prix vendu-Coefficient","Parent Prix vendu-Total(euros)","Parent Prix vendu-Total (Euros)","Parent Valorisation totale (Euros)","Parent Valorisationtotale (Euros)","Absences","Absences-Nom","Clients","Clients-SOCIETE","Clients-Email","Clients-Contact","Clients-CA","Clients-Adresse","Clients-Adresse Client","Ressources","Ressources-Compétences","Ressources-Nom","Ressources-Email","Ressources-Interne","Ressources-CV","Ressources-Adresse","Ressources-Domicile","Ressources-Tx occupation ce M","Ressources-J réalisés ce M","Ressources-J prév. ce M","Ressources-Coût J","Ressources-Duréepar défaut","Ressources-Rubrique 42","Statuts","Statuts-Nom","Tâches","Tâches-Projet","Tâches-Phase","Tâches-Tâche","Tâches-ref tâche","Tâches-Client","Tâches-Client(SOCIETE)","Tâches-Client(Email)","Tâches-Client(Contact)","Tâches-Client(CA)","Tâches-Client(Adresse)","Tâches-Client(Adresse Client)","Tâches-Prix J vendu","Tâches-Durée vendue J","Tâches-Prix vendu","Tâches-Budget prév.","Tâches-Budget réel","Véhicule","Véhicule-Nom","Véhicule-type","Poste 2-Valeurfixe","Poste 2-Valeur par unité","Poste 2-Coefficient","Poste 2-Total","Poste 2-Total(Euros)","Prix vendu-Valeur fixe","Prix vendu-Valeur par unité","Prix vendu-Coefficient","Prixvendu-Total (euros)","Prix vendu-Total (Euros)","Valorisation totale (Euros)","Valorisationtotale (Euros)","Date dernier post","Utilisateur dernier post","Calendrier horaire","Calendrierjournalier","Icône","Couleur","Règle de création d'événements","Historique-Créé le","Historique-Modifié le","Historique-Créé par","Historique-Modifié par"]

4. /event/exportInitializes an existing event export context in the planner and retrieves the data it returns.

Query

Method URL

STILOG IST, all rights reserved 26

Page 32: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

GET RACINEVP/ws/rest/event/export

Type Parameters Values

HEAD apikey String

QUERY export String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

export

UID identifier of the event export context to be initialized.

Response

The response is made up of a structure containing an error code (error), an associated message(message) and, in the event of success, a table (entities) of the event attributes returned by the exportcontext.

Error Message Entities

0 Chaque item du tableau « entities » aura la structuresuivante :

[

{

« entityName » : « name1 »,

« enityValue » : « value1 »

},

{

« entityName » : « name2 »,

« enityValue » : « value2 »

}

]

STILOG IST, all rights reserved 27

Page 33: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

1 Invalid session : apikey

2 No export context : exportUID

3 Invalid export context : exportUID

4 Fatal Error : errorMessage

5 No entities found

6 Export KO

Example:

For the “DEMO API REST” planner, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, with an export context whose internal UID identifier is 00FB-1B12-B887-9142-DCB2-B4CB-51C5-7619 and delivering the attributes Start date, End date, Customer,Project, Phase, Task, task ref internal identifier (UID) and Resources of all the events. With a userwhose access key to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/export?export=00FB-1B12-B887-9142-DCB2-B4CB-51C5-7619

Response:

{

"error":0,

"message":"",

"entities":

[

[

{"entityName":"Date de début","entityValue":"12/03/2018 00:00"},

{"entityName":"Date de fin","entityValue":"15/03/2018 00:00"},

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Analyse"},

{"entityName":"ref tâche","entityValue":"0080"},

STILOG IST, all rights reserved 28

Page 34: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

{"entityName":"Identifiant interne (UID)","entityValue":"A230-6310-E3A5-A6A0-3278-1758-1FE9-B95C"},

{"entityName":"Ressources","entityValue":""}

],

........

[

{"entityName":"Date de début","entityValue":"19/03/2018 00:00"},

{"entityName":"Date de fin","entityValue":"24/03/2018 00:00"},

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Conception"},

{"entityName":"ref tâche","entityValue":"0083"},

{"entityName":"Identifiant interne (UID)","entityValue":"9BDA-CA97-501F-4229-81F0-DABF-2DDD-FCFA"},

{"entityName":"Ressources","entityValue":""}

]

]

}

5. /event/getGets the characteristics of a set of events matching a filter in the planner in question.

Query

Method URL

POST ROOTVP/ws/rest/event/get

Type Parameters Values

HEAD apikey String

STILOG IST, all rights reserved 29

Page 35: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

DATA attributes String

DATA filterName String

DATA [extraInfos] String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

The attributes to be retrieved. [« attr1 »,…]

The attributes are identified by their label, as sent by the point of access/attributes.

filterName

Name of the applied events filter.

extraInfos [optional]

Dynamic attributes of the filter [{« entityName » : « attr2 », « entityValue » : « value2 }, …].

Response

Status Message

0

1 Invalid session : apikey

2 Invalid event filter : filterName

3 No value for variable or invalid value for invalidVariable

4 Fatal Error : errorMessage

5 Invalid attribute : attribut

6 No entities found

7 Export KO

Example:

For the planner “DEMO API REST”, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, for which we want to retrieve the attributes Start date, End date, Customer,

STILOG IST, all rights reserved 30

Page 36: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Project, Phase, Task and Resources of all the events matching the events filter “DYNAMIC RESTAPI DEMO TASK/PROJECT”, which has a dynamic PROJECT parameter on the project name.

By taking the value “Project 1” of the dynamic PROJECT parameter and with a user whose accesskey to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/get

Posted data:

{

"extraInfos":

[

{"entityValue":"Projet 1","entityName":"PROJET"}

],

"attributes":

[

"Evénement-Date de début", "Evénement-Date de fin",

"Tâches-Client", "Tâches-Projet",

"Tâches-Phase","Tâches-Tâche","Ressources"

],

"filterName":"DEMO API REST TACHE/PROJET DYNAMIQUE"

}

Response:

{

"error":0,

"message":"",

"entities":

[

[

{"entityName":"Evénement-Date de début","entityValue":"12/03/2018 00:00"},

STILOG IST, all rights reserved 31

Page 37: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

{"entityName":"Evénement-Date de fin","entityValue":"15/03/2018 00:00"},

{"entityName":"Tâches-Client","entityValue":"Client 1"},

{"entityName":"Tâches-Projet","entityValue":"Projet 1"},

{"entityName":"Tâches-Phase","entityValue":"Phase 1"},

{"entityName":"Tâches-Tâche","entityValue":"Analyse"},

{"entityName":"Ressources","entityValue":""}

],

……..

[

{"entityName":"Evénement-Date de début","entityValue":"19/03/2018 00:00"},

{"entityName":"Evénement-Date de fin","entityValue":"24/03/2018 00:00"},

{"entityName":"Tâches-Client","entityValue":"Client 1"},

{"entityName":"Tâches-Projet","entityValue":"Projet 1"},

{"entityName":"Tâches-Phase","entityValue":"Phase 1"},

{"entityName":"Tâches-Tâche","entityValue":"Conception"},

{"entityName":"Ressources","entityValue":""}

]

]

}

6. /event/addCreates a new event.

Query

Method URL

POST RACINEVP/ws/rest/event/add

Type Parameters Values

STILOG IST, all rights reserved 32

Page 38: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

HEAD apikey String

DATA attributes String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

List of the attributes used to create the event: [{« entityName » : »attr2 », »entityValue » : »value2 },…]

Response

Status Message

0 UID of the event

1 Invalid session : apikey

2 Invalid attribute : entityName

3 Create KO

Example 1:

For the “DEMO API REST” planner, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, for which we want to create an event with the attributes Start date, Enddate, Customer, Project, Phase, Task and with a user whose access key to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/add

Posted data:

{

"attributes":

[

{"entityName":"Evénement-Date de début","entityValue":"26/03/2018 00:00"},

{"entityName":"Evénement-Date de fin","entityValue":"28/03/2018 00:00"},

{"entityName":"Tâches-Client","entityValue":"Client 1"},

STILOG IST, all rights reserved 33

Page 39: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

{"entityName":"Tâches-Projet","entityValue":"Projet 1"},

{"entityName":"Tâches-Phase","entityValue":"Phase 1"},

{"entityName":"Tâches-Tâche","entityValue":"Analyse"},

{"entityName":"Statuts","entityValue":"Prévisionnel"},

]

}

Response:

{

"error":0,

"message":""

}

Example 2:

For the “DEMO API REST” planner, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, for which we want to create a child event with the Resources attribute ofthe parent event, identified by the attributes Customer, Project, Phase, Task and with a user whoseaccess key to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/add

Posted data:

{

"parentKeys":

[

{"entityName":"Tâches-Client","entityValue":"Client 1"},

{"entityName":"Tâches-Projet","entityValue":"Projet 1"},

{"entityName":"Tâches-Phase","entityValue":"Phase 1"},

{"entityName":"Tâches-Tâche","entityValue":"Analyse"},

],

"attributes":

STILOG IST, all rights reserved 34

Page 40: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

[

{"entityName":"Ressources","entityValue":"JUDITH"}

]

}

Response:

{

"error":0,

"message":""

}

7. /event/modifyEdits the characteristics of an event.

Query

Method URL

PUT RACINEVP/ws/rest/event/modify

Type Parameters Values

HEAD apikey String

DATA attributes String

DATA keys String

DATA parentKeys String

DATA forceCreate String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

attributes

List of the attributes to be edited:

[{« entityName » : « attr1 », « entityValue » : « value1 },…]

STILOG IST, all rights reserved 35

Page 41: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

keys

List of the identification attributes of the event:

[{« entityName » : « attr2 », « entityValue » : « value2 },…]

parentKeys [optional]

List of the identification attributes of the parent event:

[{« entityName » : « attr3 », « entityValue » : « value3 },…]

forceCreate [optional]

Accepts the values true or false. If the value is true, an event is created if no matching key exists inthe planner.

Response

Status Message

0

1 Invalid session : apikey

2 Invalid attribute : entityName

3 Update KO

Example:

For the planner “DEMO API REST”, installed on a Visual Planning server with the roothttp://127.0.0.1:8906/ip50, containing an event identified by the attributes Customer, Project, Phase,Task and for which we want to change the End date to 30/03/2018. With a user whose access key tothe API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/modify

Posted data:

{

"keys":

[

{"entityName":"Tâches-Client","entityValue":"Client 1"},

{"entityName":"Tâches-Projet","entityValue":"Projet 1"},

STILOG IST, all rights reserved 36

Page 42: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

{"entityName":"Tâches-Phase","entityValue":"Phase 1"},

{"entityName":"Tâches-Tâche","entityValue":"Analyse"},

],

"attributes":

[

{"entityName":"Evénement-Date de fin","entityValue":"30/03/2018 00:00"},

]

}

Response:

{

"error":0,

"message":""

}

8. /event/deleteDeletes an event from a planner.

Query

Method URL

DELETE ROOTVP/ws/rest/event/delete

Type Parameters Values

HEAD apikey String

QUERY uid String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

uid

UID (identifier) of the event.

STILOG IST, all rights reserved 37

Page 43: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Response

Status Message

0

1 Invalid session : apikey

2 No event for ‘ UID ‘

3 Delete KO

Example:

For the planner “DEMO API REST, installed on a Visual Planning server with theroot http ://127.0.0.1:8906/ip50, containing an event with the internal UID identifier6E10-4B61-27DE-08C3-0D8A-16EA-050A-B18A that we want to delete. With a user whose accesskey to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/delete?uid=6E10-4B61-27DE-08C3-0D8A-16EA-050A-B18A

Response:

{

"error":0,

"message":""

}

9. /resource/exportInitializes an existing resource export context in the planner and retrieves the data it returns.

Query

Method URL

GET ROOTVP/ws/rest/resource/export

Type Parameters Values

HEAD apikey String

STILOG IST, all rights reserved 38

Page 44: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

QUERY export String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

export

UID identifier of the resource export context to be initialized.

Response

The response is made up of a structure containing an error code (error), an associated message(message) and, in the event of success, a table (entities) of the resource attributes returned by theexport context.

Error Message Entities

0 Chaque item du tableau aura la structure suivante :

[

{

« entityName » : « name1 »,

« enityValue » : « value1 »

},

{

« entityName » : « name2 »,

« enityValue » : « value2 »

}

]

1 Invalid session : apikey

2 No export context : exportUID

3 Invalid export context : exportUID

4 Fatal Error : errorMessage

STILOG IST, all rights reserved 39

Page 45: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

5 No entities found

6 Export KO

Example:

For the “DEMO API REST” planner, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, with a resources export context with the internal UID identifier 22BE-2715-A5FF-8CD9-6D6F-3D1A-F4B4-A5DC and delivering the attributes Customer, Project, Phase, Task,task ref and the UID of the resource. With a user whose access key to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/resource/export?export=22BE-2715-A5FF-8CD9-6D6F-3D1A-F4B4-A5DC

Response:

{

"error":0,

"message":"",

"entities":

[

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Analyse"},

{"entityName":"ref tâche","entityValue":"0080"},

{"entityName":"UID","entityValue":"A230-6310-E3A5-A6A0-3278-1758-1FE9-B95C"}

],

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

STILOG IST, all rights reserved 40

Page 46: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

{"entityName":"Tâche","entityValue":"Conception"},

{"entityName":"ref tâche","entityValue":"0083"},

{"entityName":"UID","entityValue":"9BDA-CA97-501F-4229-81F0-DABF-2DDD-FCFA"}

],

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Développement"},

{"entityName":"ref tâche","entityValue":"0087"},

{"entityName":"UID","entityValue":"2664-A826-D2CC-9506-C1BE-8AE4-CAD0-1496"}

],

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Tests"},

{"entityName":"ref tâche","entityValue":"0102"},

{"entityName":"UID","entityValue":"D54B-F476-34B0-775A-3032-2A84-501E-860A"}

]

]

}

10. /resource/getRetrieves the characteristics of a set of resources matching a filter in the planner in question.

Query

Method URL

STILOG IST, all rights reserved 41

Page 47: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

POST RACINEVP/ws/rest/resource/get

Type Parameters Values

HEAD apikey String

DATA resourceModel String

DATA attributes String

DATA filterName String

DATA [extraInfos] String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

resourceModel

Name of the dimension

attributes

The attributes to be retrieved. [« attr1 »,…]

The attributes are identified by their label, as sent by the point of access/attributes.

filterName

Name of the applied resource filter.

extraInfos [optional]

Dynamic attributes of the filter [{« entityName » : « attr2 », « entityValue » : « value2 }, …].

Response

Status Message

0

1 Invalid session : apikey

2 Invalid resource model : resourceModel

3 Invalid resource filter: filterName

4 No value for variable or invalid value for invalidVariable

STILOG IST, all rights reserved 42

Page 48: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

5 Fatal Error : errorMessage

6 Invalid attribute: attribute

7 No entities found

8 Export KO

Example:

For the planner “DEMO API REST”, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, for which we want to retrieve the attributes Customer, Project, Phaseand Task of the “Tasks” dimension matching the resource filter “DYNAMIC REST API DEMO TASK/PROJECT”, which has a dynamic PROJECT parameter on the project name.

By taking the value “Project 1” of the dynamic PROJECT parameter and with a user whose accesskey to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/resource/get

Posted data:

{

"extraInfos":

[

{"entityValue":"Projet 1","entityName":"PROJET"}

],

"attributes":

[

"Tâches-Client", "Tâches-Projet",

"Tâches-Phase","Tâches-Tâche"

],

"resourceModel":"Tâches",

"filterName":"DEMO API REST TACHE/PROJET DYNAMIQUE"

}

Response:

STILOG IST, all rights reserved 43

Page 49: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

{

"error":0,

"message":"",

"entities":

[

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Analyse"},

],

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Conception"},

],

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

{"entityName":"Tâche","entityValue":"Développement"},

],

[

{"entityName":"Client","entityValue":"Client 1"},

{"entityName":"Projet","entityValue":"Projet 1"},

{"entityName":"Phase","entityValue":"Phase 1"},

STILOG IST, all rights reserved 44

Page 50: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

{"entityName":"Tâche","entityValue":"Livraison"},

]

]

}

11. /resource/addCreates a new resource.

Query

Method URL

POST RACINEVP/ws/rest/resource/add

Type Parameters Values

HEAD apikey String

DATA resourceModel String

DATA attributes String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

resourceModel

Name of the dimension

attributes

List of the attributes used to create the event. [{"entityName":"attr2","entityValue":"value2 },...]

Response

Status Message

0 UID of the resource

1 Invalid session: apikey

2 Invalid resource model: resourceModel

STILOG IST, all rights reserved 45

Page 51: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

3 Invalid attribute : attribute

4 Create KO

Example:

For the “DEMO API REST” planner, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, for which we want to create a resource of the “Tasks” dimension withthe attributes Customer, Project, Phase, Task and with a user whose access key to the API is:d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/resource/add

Posted data:

{

"attributes":

[

{"entityName":"Tâches-Client","entityValue":"Client 1"},

{"entityName":"Tâches-Projet","entityValue":"Projet 1"},

{"entityName":"Tâches-Phase","entityValue":"Phase 2"},

{"entityName":"Tâches-Tâche","entityValue":"Conception"}

],

"resourceModel":"Tâches"

}

Response:

{

"error":0,

"message":""

}

12. /resource/modifyEdits the characteristics of a resource.

STILOG IST, all rights reserved 46

Page 52: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Query

Method URL

PUT RACINEVP/ws/rest/resource/modify

Type Parameters Values

HEAD apikey String

DATA resourceModel String

DATA attributes String

DATA keys String

DATA forceCreate String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

resourceModel

Name of the dimension

attributes

List of the attributes to be edited: [{"entityName":"attr1","entityValue":"value1 },...]

keys

List of the identification attributes of the resource: [{"entityName":"attr2","entityValue":"value2 },...]

forceCreate [optional]

Accepts the values true or false. If the value is true, an event is created if no matching key exists inthe planner.

Response

Status Message

0

1 Invalid session: apikey

2 Invalid resource model: resourceModel

STILOG IST, all rights reserved 47

Page 53: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

3 Invalid attribute : attribute/key

4 Update KO

Example:

For the planner “DEMO API REST”, installed on a Visual Planning server with the roothttp://127.0.0.1:8906/ip50, containing a resource of the “Tasks” dimension, identified by the attributesCustomer, Project, Phase and for which we want to change the value of the Task attribute to“Analysis”. With a user whose access key to the API is: d9f79618-59e4-a710-8203-a39bab9ad09b,we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/modify

Posted data:

{

"keys":

[

{"entityName":"Tâches-Client","entityValue":"Client 1"},

{"entityName":"Tâches-Projet","entityValue":"Projet 1"},

{"entityName":"Tâches-Phase","entityValue":"Phase 2"},

],

"attributes":

[

{"entityName":"Tâches-Tâche","entityValue":"Analyse"},

],

"resourceModel":"Tâches"

}

Response:

{

"error":0,

"message":""

STILOG IST, all rights reserved 48

Page 54: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

}

13. /resource/deleteDeletes a resource from a planner.

Query

Method URL

DELETE RACINEVP/ws/rest/resource/delete

Type Parameters Values

HEAD apikey String

QUERY uid String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

uid

UID (identifier) of the resource.

Response

Status Message

0

1 Invalid session : apikey

2 No eventResource for : UID

3 Delete KO

Example:

For the planner “DEMO API REST, installed on a Visual Planning server with the roothttp ://127.0.0.1:8906/ip50, containing a resource with the internal UID identifier 1BF0-D576-8000-9F67-55EE-1946-D608-0332 that we want to delete. With a user whose access key to theAPI is: d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

STILOG IST, all rights reserved 49

Page 55: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

URL:

http://127.0.0.1:8906/ip50/ws/rest/event/delete?uid=1BF0-D576-8000-9F67-55EE-1946-D608-0332

Response:

{

"error":0,

"message":""

}

14. /link/createCreates a link between two events.

Query

Method URL

POST RACINEVP/ws/rest/link/create

Type Parameters Values

HEAD apikey String

DATA beginUID String

DATA endUID String

DATA type String

DATA mode String

DATA behavior String

DATA delayType String

DATA delay int

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

beginUID

STILOG IST, all rights reserved 50

Page 56: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

UID identifier of the start event.

endUID

UID identifier of the end event.

type

Type of link (End to start, Start to start, End to end, Start to end)« END_BEGIN »,« BEGIN_BEGIN »,« END_END »,« BEGIN_END ».

behavior

Behavior of the link (Adjust, Warning, Constraint) « ADJUST »,« WARNING »,« CONSTRAINT ».

mode

Link mode (Strict delay, Maximum delay, Minimum delay)« STRICT »,« ADJUSTMIN »,« ADJUSTMAX ».

delayType

Delay type (Hourly, Daily) « DAY »,« HOUR »

delay

Delay between the start event and the end event (in minutes or in days)

Response

Status Message

0

1 Invalid session: apikey

2 Begin event must be different of the end event

3 Invalid begin or end event UID

Link already exists

4 Invalid link type : type

5 Invalid link mode : mode

6 Invalid delay type : delayType

7 Invalid link behavior : behavior

8 Create KO

STILOG IST, all rights reserved 51

Page 57: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Example:

For the planner “DEMO API REST”, installed on a Visual Planning server with theroot http ://127.0.0.1:8906/ip50, containing two events with the internal UID identifiersADEE-00A1-63ED-573F-ADA4-3175-87EE-D5F9 and D4C5-34EE-3028-3655-7BB0-4F6D-BE2D-E973, and for which we want to create an END_BEGIN type link in STRICT mode, with the ADJUSTbehavior and the DAY delay type, lasting 2 days. With a user whose access key to the API is:d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/link/create

Posted data:

{

"beginUID":" ADEE-00A1-63ED-573F-ADA4-3175-87EE-D5F9 ",

"endUID":" D4C5-34EE-3028-3655-7BB0-4F6D-BE2D-E973 ",

"type":"END_BEGIN",

"mode":"STRICT",

"behavior":"ADJUST",

"delayType":"DAY",

"delayType":"2"

}

Response:

{

"error":0,

"message":""

}

15. /link/deleteDeletes a link between two events.

Query

Method URL

STILOG IST, all rights reserved 52

Page 58: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

DELETE RACINEVP/ws/rest/link/delete

Type Parameters Values

HEAD apikey String

QUERY beginUID String

QUERY endUID String

apikey

The user’s API key (must be sent in all the queries). Accesses the WebService for a given user andplanner.

beginUID

UID identifier of the start event.

endUID

UID identifier of the end event.

Response

Status Message

0

1 Invalid session: apikey

2 The begin event must be different from the end event

3 Invalid begin or end event UID

4 Delete KO

Example:

For the planner “DEMO API REST”, installed on a Visual Planning server with theroot http ://127.0.0.1:8906/ip50, containing two events with the internal UID identifiersADEE-00A1-63ED-573F-ADA4-3175-87EE-D5F9 and D4C5-34EE-3028-3655-7BB0-4F6D-BE2D-E973, and for which we want to delete the link. With a user whose access key to the API is:d9f79618-59e4-a710-8203-a39bab9ad09b, we have:

URL:

http://127.0.0.1:8906/ip50/ws/rest/link/delete?beginUID=ADEE-00A1-63ED-573F-ADA4-3175-87EE-D5F9&endUID= D4C5-34EE-3028-3655-7BB0-4F6D-BE2D-E973

STILOG IST, all rights reserved 53

Page 59: WebServices API - visual-planning.com · Access to these WebServices is protected by an API key. This key is dedicated to one user who must be explicitly declared in the AdminCenter

WebServices API

Response:

{

"error":0,

"message":""

}

STILOG IST, all rights reserved 54