Skip to content

FavoriteApi

HTTP request Description
POST /favorite/addfavorite Adds a new organization to the user's favorite organization list.
GET /favorite/{userId} Gets the list of favorite organizations of a user.
POST /favorite/removefavorite Removes the organization from the user's favorite organization list.

POST /favorite/addfavorite

Adds a new organization to the user's favorite organization list. If the organization has trackingMode: authenticated, then the user account of the organization must be linked to Stalker's account. Only app users can access this end-point.

Parameters

Name Type Description
favorite Favorite

Responses

201
Organization successfully added to the list of favorite. The favorite record just added (including the organization) gets returned. Favorite

400
The user already added the organization to the list of favorite organizations.

401
The user is not authenticated. Nothing gets returned.

403
Users who did not bind their account with their organization's account and administrators cannot have access. Nothing gets returned.

404
The organization could not be found. Nothing gets returned.

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

GET /favorite/{userId}

Gets the list of favorite organizations of a user. Only app users can access this end-point.

Parameters

Name Type Description
userId String ID of the user. It must be the same of the userId of the authenticated user.

Responses

200
List of favorite organizations returned successfully. List

204
List of favorite organizations is empty. Nothing gets returned.

400
The supplied userId is incorrect. Nothing gets returned.

401
The user or the administrator is not authenticated. Nothing gets returned.

403
Administrators cannot have access. Nothing gets returned.

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

POST /favorite/removefavorite

Removes the organization from the user's favorite organization list. Only app users can access this end-point.

Parameters

Name Type Description
favorite Favorite

Responses

205
Organization successfully removed from the list of favorites.

401
The user is not authenticated. Nothing gets returned.

403
Administrators cannot have access. Nothing gets returned.

404
The favorite was not found, hence it was not removed. Nothing gets returned.

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json