Other REST APIs to work with the server and logs

The following REST APIs are available for checking server status, connection parameters, and working with FMPS logs.

Get the server status

A GET method that returns the status of the server component.

Request URL

http://<FMPS_server>:<port>/ping

Successful response

Returns a HTTP 200 (Successful) response with JSON object containing information about the server’s status.

Error response
Code Type Description
500 String A error occurred while retrieving the server’s status.

Get server connection parameters

A GET method that retrieves the server’s connection parameters.

Request URL

http://<FMPS_server>:<port>/v16/connectionParameter

Header
Name Type Description
content-type String Type of content that is sent in the request.
Header example
{
  "content-type": "application/json",
}
Successful response

Returns a HTTP 200 (Successful) response with JSON object containing server’s connection parameters.

Error response
Code Type Description
400 String A bad request is sent.

Enable or disable logging and change log level

A POST method that enables or disables logging. By default, logs are turned off. You can also configure logs from the application’s user interface, for more details see Specify default log settings.

In addition to enabling logs, you can also configure the log level. The possible values for log level are: FATAL, ERROR, WARN, INFO, andDEBUG. By default, log level is set to INFO.

You can either enable the logs or set the log level, or configure both by providing the required parameters in query string of the API.

Request URL

http://<FMPS_server>:<port>/v16/enableLogging?enable=[]&level=[]

Header
Name Type Description
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Request body
Name Type Description
enable Integer Query parameter that enables (1) or disables (0) logs.
level String Query parameter that sets the level of logging information to capture. Possible values are: FATAL, ERROR, WARN, INFO, andDEBUG.
JSON body example
?enable=0
?level=ERROR
Successful response

Returns a HTTP 200 (Successful) response.

Error response
Code Type Description
400 String A bad request is sent.
403 String Access not granted.

Get last n number of logs for a specific task

A GET method that retrieves the last n number of logs for a specific task. It uses the task ID and the number specified in the parameters to retrieve the logs.

Request URL

http://<FMPS_server>:<port>/v16/logs/task/list/:id/:lastnrun

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Parameter
Name Type Description
id String The unique ID of the task for which you want to retrieve the logs.
lastnrun Integer The number of last n logs to retrieve for the given task.
Parameter example
5e4302fafdfdfadsfdfasgafsafgsag
5
Successful response

Returns a HTTP 200 (Successful) response with the last n logs for the task.

Error response
Code Type Description
400 String A bad request is sent.

Get logs for a specific task by its run ID

A GET method that retrieves the logs for a specific task using the run ID. It uses the task ID and the run ID in the parameters to retrieve the logs. In addition, you can also specify the type of logs to retrieve in the query string.

Request URL

http://<FMPS_server>:<port>/v16/logs/task/run/:id/:runid

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Parameter
Name Type Description
id String The unique ID of the task for which you want to retrieve the logs.
runid Integer ID of the run task for which you want to retrieve the logs.
Parameter example
5e4302fafdfdfadsfdfasgafsafgsag
5e4302fafdfdfadsfdfasgafsafgsag
Successful response

Returns a HTTP 200 (Successful) response with the logs for the given task and run ID.

Error response
Code Type Description
400 String A bad request is sent.

Get all clients (or workers)

A GET method that retrieves all clients that are available and ready to take publishing tasks from the server.

Request URL

http://<FMPS_server>:<port>/v16/worker/getallworkers

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Successful response

Returns a HTTP 200 (Successful) response with an array of all clients (or workers).

Error response
Code Type Description
400 String A bad request is sent.

May 30, 2024

Legal Notices | Online Privacy Policy