ProJect - Save favourite selections

API Url

Used for upsarting employee favourite project selection (templates). For now, only send one record at a time, or else make sure 'favourites.id' is unique.

PUT
http://localhost:16010/ProMarkREST/rest/ProJect/employees/{id}/favourites

Permissions: user

Path parameters

FieldTypeDescription
idString

Employee ID for whom to save favourites.

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    favouritesObject[]

Collection of project favourites.

      activityIdString

The Activity identifier.

      extraInfooptionalObject[]

Collection of project extra info. Needs to be last in JSON.

        infoString

Extra info type (ex: "DEPT:", "GROUP:", "FREE").

        valueIdString

Extra info value identifier, related to 'extraInfo.info'.

      idoptionalNumber

Unique identifier of the favourite record.

      pieceworkIdoptionalString

The piecework identifier.

      projectIdString

The Project identifier.

      registeredTimeNumber[]

Default registration time in seconds for one week, starting with Monday.

      timeTypeIdoptionalString

The Time type identifier.

Request example for new record:

{
"request": {
"data": {
"favourites": [
{
"projectId": "Aarsleff",
"activityId": "ACT1",
"timeTypeId": "Machine",
"extraInfo": [
{
"info": "MACHINE",
"valueId": "MACH1"
}
]
}
]
}
}
}

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    favouritesObject[]

Collection of project favourites.

      activityIdString

The Activity identifier.

      extraInfooptionalObject[]

Collection of project extra info. Needs to be last in JSON.

        infoString

Extra info type (ex: "DEPT:", "GROUP:", "FREE").

        valueIdString

Extra info value identifier, related to 'extraInfo.info'.

      idoptionalNumber

Unique identifier of the favourite record.

      pieceworkIdoptionalString

The piecework identifier.

      projectIdString

The Project identifier.

      registeredTimeNumber[]

Default registration time in seconds for one week, starting with Monday.

      timeTypeIdoptionalString

The Time type identifier.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

Success example for a new record:

{
"response": {
"data": {
"favourites": [
{
"id": 12345678,
"projectId": "Aarsleff",
"activityId": "ACT1",
"timeTypeId": "Machine",
"extraInfo": [
{
"info": "MACHINE",
"valueId": "MACH1"
}
]
}
]
}
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.