Create Work Unit Web Service

Use the Create Work Unit Web Service to interface with ATPCO systems and create empty work units that can be used as the starting point of your workflows for creating and distributing Fares, Rules, and Footnotes data.

Request

Your request to the Create Work Unit Web Service must provide a valid OAuth access token and a userId in the header. See OAuth Access Tokens and Authentication for more information.

You can also optionally specify the following parameters in the request body:

  • Work Unit Name
  • Description
  • Email IDs
  • Exclusive Access

Request Header Parameters

See OAuth Access Tokens and Authentication for full instructions on header parameters needed for authentication.

Request Body

The request body should be formatted as a JSON object, which can be empty.

Empty request object

Copy
Copied
{}

Request Object Parameters

The request object can include any of the following optional parameters:

Parameter Description Type Format Example
description Free-form text that describes the content or initiative of the created work unit String Alphanumeric between 0-200 characters that permits the special characters hyphen (-), forward slash (/), comma (,), period (.), and space ( ) "free-form text"
emailIds One or more email addresses where work-unit-related notifications will be sent String Alphanumeric, comma-separated email addresses that each contain one at symbol (@) followed by at least one period (.) and are between 0-1250 characters "donotreply@atpco.net"
exclusiveAccess Flag indicating whether or not access to the work unit should be restricted to the organization that created it (default is "N") String "Y" (enables exclusive access) or "N" (disables exclusive access) "Y"
workUnitName Name that describes the created work unit String Alphanumeric between 0-10 characters that permits the special characters hyphen (-), forward slash (/), comma (,), period (.). "09-A1456"

Response

Upon successful processing of a request, the newly-created work unit will have a work unit ID that includes the same Work Unit Owning Organization Code as that of the sending organization. The Create Date of the new work unit will be the date the request was processed.

The response to a successful Create Empty Work Unit service call will contain a JSON object including the parameters specified in the request body and the Work Unit ID generated for the new work unit.

Example response object

Copy
Copied
{
  "description": "Work Unit",
  "workUnitName": "WUAPI",
  "emailIds": "testapi@atpco.net,testapi2@atpco.net",
  "exclusiveAccess": "N",
  "workUnitId": "AA-23JUL17-89"
}

The generated Work Unit ID is a string of the form XXX-DDMMMYY-NNNNNNN, where:

  • XXX is the 2-3 character organization code associated with the userId specified in the request header
  • DDMMMYY is the creation date of the work unit
  • NNNNNNN is a numeric identifier of the work unit

Response Parameters

The response object can include the following parameters:

Work Unit Details

Parameter Description Type Example
description Free-form text that describes the content or initiative of the created work unit String "free-form text"
emailIds One or more email addresses where work-unit-related notifications will be sent String "donotreply@atpco.net"
exclusiveAccess Flag indicating whether or not access to the work unit is restricted to the organization that created it String "Y"
workUnitId Unique identifier assigned to the created work unit String "XXX-17MAR18-1234567"
workUnitName Name that describes the created work unit String "09-A1456"

Example Requests and Responses

The following examples show what the Create Work Unit Web Service would return based on the indicated requests.

Request with No Parameters Specified

When no parameters are provided in the request, the exclusiveAccess field will default to "N".

request response
Copy
Copied
//Empty request object
{}
Copy
Copied
{
   "description": "",
   "emailIds": "",
   "exclusiveAccess": "N",
   "workUnitId": "91-14MAR18-76",
   "workUnitName": ""
}

Request with All Parameters Specified

When parameters are provided in the request, they are used to populate the fields in the created work unit.

request response
Copy
Copied
//Example request object with all parameters
{
  "description": "This is a test",
  "emailIds": "donotreply@atpco.net",
  "exclusiveAccess": "Y",
  "workUnitName": "TEST"
}
Copy
Copied
//Example response to request with all parameters
{
   "description": "This is a test",
   "emailIds": "DONOTREPLY@ATPCO.NET",
   "exclusiveAccess": "Y",
   "workUnitId": "91-14MAR18-81",
   "workUnitName": "TEST"
}

Request with Some Parameter Specified

request response
Copy
Copied
//Example request object with a single `emailIds` only
{
  "emailIds": "donotreply@atpco.net"
}
Copy
Copied
//Example response to request with single `emailIds` only
{
   "description": "",
   "emailIds": "DONOTREPLY@ATPCO.NET",
   "exclusiveAccess": "N",
   "workUnitId": "91-14MAR18-84",
   "workUnitName": ""
}