REST WebService /resource/get

 

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

Query

 

Method

URL

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 and planner.

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

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 root http ://127.0.0.1:8906/ip50, for which we want to retrieve the attributes Customer, Project, Phase and Task of the “Tasksdimension matching the resource filterDYNAMIC 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 access key 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:

{

“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″},

{“entityName”:”Tâche”,”entityValue”:”Livraison”},

]

]

}

Print Friendly, PDF & Email
1 Etoile2 Etoiles3 Etoiles4 Etoiles5 Etoiles (No vote)
Loading...
Consulting training

Need training?

Use our consulting services!