API Security
An API Key Security is a code used to authenticate an application. To enable API Key Security for Console and Silent Installation, see TIBCO Foresight® REST API Installation Guide.
The user needs authentication to use an API key security. To authenticate the user, send a GET request to the
<server-url>/ForesightREST/authenticate
Select Authorization Type as Basic Auth. Enter Username and Password.
By default, there are 2 users, one with admin scope and the other with register scope.
| Users | Username | Password |
|---|---|---|
| User 1 | admin | admin |
| User 2 | fsrestclient | fsrestclient |
The user 1 has the admin scope and user 2 has only the register scope. The list of scope is as follows:
| Scope | Description |
|---|---|
| jobs/crd | The user can create, read and update jobs. |
| datafiles/urd | The user can read, update and delete datafiles. |
| guidelines/urd | The user can read, update and delete guidelines. |
| controlfiles/urd | The user can read, update and delete controlfiles. |
| outputfiles/rd | The user can read and delete outputfiles. |
| fsenvvars/u | The user can update fsenvvars. |
| maps/urd | The user can update, read and delete maps. |
The user with admin scope can create, read, update and delete all the scopes along with the registration of the application. Also, the user can assign scope as per the requirement, for example, to give permission for read only job, user can provide scope jobs/r.
The user with register scope can only register the application.
To register an application send a POST request to the
<server-url>/ForesightREST/register
Add the parameters mentioned in the below sample body:
{ "name": "job app", "description": "Desc", "organization": "organization", "scope": "jobs/crd outputfiles/rd datafiles/rd", "emailId": "abc@pqr.com", "contactName": "abc" }
Also, provide the API token or key received while authenticating the request.