/
EmpAddAct RESTified API

EmpAddAct RESTified API

5.4.0

A pass-through API to Scheduling (when configured) which allows the Scheduling's EmpAddActRequest API to be called.

Description

Standard activities cannot exist on their own; they only exist when allocated to an employee (EmpID). Therefore there is no "create" API method. Instead, the EmpAddAc API method is used to create new standard activities and allocate them at the same time.  

On this page:

Related pages:

Resource URL Summary


Pass Through Call to Scheduling's "EmpAddActRequest" API

PUT /up/v5/rest/scheduling/EmpAddAct

HTTP Headers

This API uses the standard ServiceBroker HTTP Headers.


API Specifics


Pass Through Call to Scheduling's "EmpAddActRequest" API

This RESTified API will perform a pass-through call to the Scheduling sub-system's "EmpAddActRequest" API (when configured).

URL

PUT /up/v5/rest/scheduling/EmpAddAct

HTTP Request Body

This request requires a JSON object supplied in the HTTP request body, which defines the parameters that will be passed through to the Scheduling "EmpAddActRequest" API.

EmpAddAct Object Format

EmpAddAct JSON
{
	"empID": "",
	"actType": "",
	"expectedStart": "",
	"expectedEnd": "",
	"locType": "",
	"notes": "",
	"TZType": "",
	"Dispatch": false,
	"TravelMode": "",
	"Duration": "",
	 "options": {
		"CheckJobs": false,
		"CheckStdActs": false,
		"CheckJobsDealloc": false,
		"CheckJobsShuffle": false,
		"CheckJobsAllowBreakAH": false,
		"CheckFrozen": false,
		"OverlapBreaks": false
	}
}


EmpAddAct Object Properties

Property

Type

Length

Description

Req?

Field Mapping: Scheduling

empID

string

SS: 25

Identifier of the employee that the newly created standard activity will be allocated to.


Yes

empID

actType

string

SS: 30

Type of standard activity which should be created

Yes

actType

expectedStart

string

SS: 8

Date and time of when the new standard activity should start (employee local or default – see 12).  If the time part isn’t supplied, it defaults to the start of the operative’s day.

Local to the employee doing the activity or, if the employee has no timezone, local to the default timezone.

Example: "2023-03-30"

Yes

expectedStart

expectedEnd

string

SS: 8

Date and time (employee local or default) when the new standard activity should end.  If the time part isn’t supplied, it defaults to the end of the operative’s day.  If an empty string (“”) is supplied, the new activity will last indefinitely but this is only allowed if the employee is posted to the same FRU (but not necessarily to the same Team within that FRU) indefinitely, otherwise SP_POSTING_HAS_ENDDATE (285) will be returned.

expectedEnd and expectedDuration cannot both be populated – if both are then SP_SA_CONFLICTING_END (665) will be returned.

Local to the employee doing the activity or, if the employee has no timezone, local to the default timezone.

Example: "2023-03-30"

No

expectedEnd

locType

string

SS: See Valid Values

Specifies where the new standard activity is to be located:

at a supplied postal code (in Act.EndPostCode (below)),

at the employee’s home region,

at the employee’s depot’s region (not available in V4.4 if the operative isn’t on shift),

at the employee’s work region,

at the employee’s start region on the day of the activity (if he’s on shift), taking overrides into account,

at the employee’s end region on the day of the activity (if he’s on shift), taking overrides into account

Note: Can be missing but, unless StandardActivityTravelMode has a value other than NoTravel, this will result in SP_ACT_LOC_TYPE_INVALID (152) being returned, since the activity’s location must be known to SERVICEOptimizer for travel to be included.

SS Valid Values: "Home", "Work", "Depot", "Supplied", "None"

No

locType

notes

String

SS: 503

This field is for user annotation and can either be any text string or it can be empty (“”). It appears on the Gantt Show Activity Details window, where it can also be edited.

No

N/A

TZType

String

SS: 

SS: See Valid Values

Defaults to Employee Time Zone.

SS Valid Values: "Home", "FRU", "Location", "Default"

No

TZType

Dispatch

Boolean

 

Determines whether or not this specific standard activity will be included in any dispatching process. Defaults to value associated with actType.

No

Dispatch

TravelMode

String


SS: See Valid Values

Determines whether the standard activity will be allocated travel and, if so, how that travel behaves w.r.t the start of the SA 

SS Valid Values: "None", "ETS", "ETA"

Yes

TravelMode

Duration

integer

 

The number of minutes the standard activity is expected to last. expectedEnd and expectedDuration cannot both be populated – if both are then SP_SA_CONFLICTING_END (665) will be returned.

No

Duration

optionsObject

Pass through parameter to the Scheduling EmpAddAc API. 


see EmpAddAc.Options.Objects

HTTP Response

Success

On success, a JSON-formatted version of the Scheduling "EmpAddActRequest" API response will be returned.

{
    "Success": true,
    "Code": 0,
    "Message": "OK",
    "Payload": {
        "result": {
            "type": "OK",
            "code": "0"
        },
        "actID": "88139"
    }
}

Error

On error, a JSON-formatted version of the Scheduling "EmpAddActRequest" API response will be returned.

{
    "Success": false,
    "Code": 9,
    "Payload": {
        "returnCode": {
            "type": "Error",
            "code": "SCH Error Code"
        }
    }
}

Return Codes

In addition to the Standard Return Codes, and the Scheduling Error codes, the possible Return Codes from this API are:

 Click here to expand...
  • SP_POSTCODE_INVALID (3)
  • SP_EMPID_INVALID (5)
  • SP_DURATION_INVALID (12)
  • SP_END_NOT_GT_START_TIME (31)
  • SP_OUTSIDE_HORIZON (53)
  • SP_START_TIME_INVALID (62)
  • SP_END_TIME_INVALID (63)
  • SP_OPTIONS_INVALID (80)
  • SP_NO_REG_TO_RU_MAPPING (115)
  • SP_ACTIVITY_TYPE_INVALID (120)
  • SP_ACTIVITY_NOTES_INVALID (123)
  • SP_EMP_NOT_IN_TEAM (124)
  • SP_TEAM_NOT_IN_RU (125)
  • SP_OVERLAPPED_JOBS (132)
  • SP_ACT_LOC_TYPE_INVALID (152)
  • SP_OPTION_COMBINATION_INVALID (159)
  • SP_OVERLAPPED_STDACTS (160)
  • SP_EMPID_DOES_NOT_EXIST (231)
  • SP_POSTING_HAS_ENDDATE (285)
  • SP_SPANS_POSTINGS (286)
  • SP_WOULD_BREAK_ACCESS_HOURS (371)
  • SP_OK_WITH_OVERLAPS (373)
  • SP_DST_TIME_INVALID (379)
  • SP_FROZEN_DAY (585)
  • SP_OK_CAPACITY_EXCEEDED (640)
  • SP_SA_CONFLICTING_END (665)
  • SP_SATM_INVALID (667)
  • SP_SA_DISPATCH_INVALID (670)
  • SP_SA_TRAVELMODE_ENDTIME_INVALID (672)
  • SP_SA_LOCATIONTYPE_MISSING_POSTCODE (673)





Related content

REST APIs
Read with this
EmpCreate RESTified API
EmpCreate RESTified API
More like this