---
title: Webservices NEURO
slug: dev-en/webservices-neuro
description: Learn about the REST services provided for efficient utilization of services via Rest. This document enumerates the URLs, descriptions, parameters, and returns for each service in a comprehensive table. Find guidelines for accessing the REST API, includin
docTags: 
createdAt: 2022-03-07T15:14:54.000Z
---

This document gathers the minimum knowledge necessary for the adequate use of&#x20;the services via Rest.

| **URL**                                           | **Description**                           | **Parameters**                                | **Return**                                        |
| ------------------------------------------------- | ----------------------------------------- | --------------------------------------------- | ------------------------------------------------- |
| **/startWithMap/&#x7B;name}**                     | Starts an ESI flow by name                | name: Name of the registered flow             | Representation of the registered flow object      |
| **/instance/initialize/&#x7B;processInstanceId}** | Retrieve the values of a process instance | processInstanceid: ID of the process instance | Representation of the registered process instance |
| **/instance/suspend/&#x7B;processInstanceId}**    | Suspends a process instance               | processInstanceid: ID of the process instance | Representation of the registered process instance |
| **/instance/restart/&#x7B;processInstanceId}**    | Restarts a process instance               | processInstanceid: ID of the process instance | Representation of the registered process instance |
| **/instance/reopen/&#x7B;processInstanceId}**     | Reopens a process instance                | processInstanceid: ID of the process instance | Representation of the registered process instance |
| **/userTask/&#x7B;userTaskId}**                   | Retrieves a user task                     | userTaskId: ID of the created user task       | Representation of the registered process instance |
| **/rule/executeWithMap/&#x7B;name}**              | Executes a business rule                  | name: Name of the registered business rule    | Representation of the executed business rule      |

- request body: JSON Object with the variables for the flow
- request body: JSON Object with the variables for the business rule

Table 1 - Specification of APPLICATION PROGRAMMABLE INTERFACE&#x53;**&#xA0;**(API)

## SPECIFIC GUIDELINES FOR THE REST API ACCESS

In the following sections, each type of intended use for the services available via Rest is detailed in the CITSMart Enterprise Neuro product.

### Authentication

To use the APIs, the client must be logged in to Neuro. To do this, simply get a token from the authentication service and inject that token into the header of each REST request with the authentication token identifier.
Authentication is done through the POST **/cit-esi-web/rest/security/token** service, passing a JSON object with the username and password attributes in the body.

::Image[]{src="../img/9181.png" size="50" isUploading="false" showCaption="false"}

Figure 1 - Example using the Chrome Restart Client plugin

### Business Objects REST API

Each business object provides a set of REST services that can be consumed from the URL **/cit-esi-web/dynamic/\{application name}/\{business object name}**. These are basic services for creating, updating, listing, and deleting the business object, as well as a *getStructure&#x20;*&#x6D;ethod that returns the metadata of the business object. Each SQL created in the business object can also be called in method form.
Following are examples using the hotel business object of the hotel application. For each request, the *authentication-token* obtained in the login service must be provided. The URL should end with ".json".

### Inclusion of business object

- **HTTP verb**: POST
- **URL:** /cit-esi-web/rest/dynamic/\{application name}/\{business object name}.json
- **Body:** JSON containing the attributes of the business object record to be included

::Image[]{src="../img/9182.png" size="50" isUploading="false" showCaption="false"}

Figure 2 - Inclusion of business object

### Business Object Change

- **HTTP verb**: POST
- **URL**: /cit-esi-web/rest/dynamic/\{application name}/\{business object name} /update.json
- **Body**: JSON containing the attributes of the business object record to be changed

::Image[]{src="../img/9183.png" size="50" isUploading="false" showCaption="false"}

Figure 3 - Change of business object

### Business Object Deletion

- **HTTP verb**: POST
- **URL**: /cit-esi-web/rest/dynamic/\{application name}/\{business object name}/remove.json
- **Body**: JSON containing the primary key of the business object record to be deleted

::Image[]{src="../img/9184.png" size="50" isUploading="false" showCaption="false"}

Figure 4 - Business Object Deletion

### Listing of business objects

- **HTTP verb**: GET
- **URL**: /cit-esi-web/rest/dynamic/\{application name}/\{business object name}.json

::Image[]{src="../img/9185.png" size="50" isUploading="false" showCaption="false"}

Figure 5 - Listing of business objects

### Business object recovery by primary key

- **HTTP verb**: POST
- **URL**: /cit-esi-web/rest/dynamic/\{application name}/\{business object name}/restore.json
- **Body**: JSON containing:
  - The primary key of the business object record to be deleted;
  - Attribute boolean findManyToOne, indicating whether the system should retrieve many relationships for one of the objects;
  - Boolean findOneToMany attribute, indicating whether the system should retrieve one-to-many relationships from the object.

::Image[]{src="../img/9186.png" size="50" isUploading="false" showCaption="false"}

Figure 6 - Recovery of a business object by primary key

### Retrieving the structure of the business object

- **HTTP verb**: GET
- **URL**: /cit-esi-web/rest/dynamic/\{application name}/\{business object name}/getStructure.json

::Image[]{src="../img/9187.png" size="50" isUploading="false" showCaption="false"}

Figure 7 - Recovery of the structure of the business object

### SQL Execution of the Business Object

- **HTTP verb**: POST
- **URL**: / cit-esi-web / rest / dynamic / \{application name} / \{business object name} /list.son
- **Body**: JSON containing:
  - SQLName attribute with the name of the SQL to be executed
  - JSON *dynamicModel&#x20;*&#x61;ttribute containing the expected parameter values in SQL
  - Attribute boolean findManyToOne (optional), indicating whether the system should retrieve many relationships for one of the object
  - Attribute boolean findOneToMany (optional), indicating whether the system should retrieve one-to-many relationships from the object

::Image[]{src="../img/9188.png" size="50" isUploading="false" showCaption="false"}

Figure 8 - SQL execution of the business object

### Execution of ESI streams

Any ESI stream can be executed via REST using the POST service **/cit-esi-web/rest/esi/execute/\{stream name}**. For each request, the *authentication-token* obtained in the login service must be provided.
In the body of the request, a JSON containing the input variables required to execute the flow must be provided.
The example below performs the job-search flow, providing the "12345" enrollment as the input variable of the stream.&#x20;The stream returns the "employee" JSON object.

::Image[]{src="../img/9189.png" size="50" isUploading="false" showCaption="false"}

Figure 9 - Example of running ESI streams

