Overview
This article contains documentation for the Job web service, all related API calls and possible errors.
You can use Ctrl+F to search for the required method or error message.
For more information about all available Web Services and corresponding methods, refer to the Introduction to Web Services article.
Information
This web service includes the following methods:
- createJobs
- createJob
- updateJobs
- createOrUpdateJobs
- createOrUpdateJob
- createOrUpdateJobs2
- getJobByReferenceNumber
- getJobs
- getJobsByDivision
- assignWorkerToJob
- unassignJob
- removeWorkerFromJob
- deleteJob
- terminateJob
- terminateJobForWorker
- restoreJob
- getUpdatedActionsByDivision
- getUpdatedActions
- getJobActionsByDivision
- getJobActions
- assignWorkerAndUpdateJob
- submitJobAction
Job service provides a set of APIs to manage jobs. This service includes APIs to create/update/delete jobs, get job details, actions, and action updates. As a part of enhancement, we have added new features like invoice, dispatcher Id, etc. To provide the web service support for these enhancements we have added new versions over time. The latest version of job service is jobservice-0.0.6. The following table will help to identify the new features in each version.
Version |
What’s New |
---|---|
Job Service-0.0.1 JobService-wrapped-0.0.1 |
Initial implementation |
JobService-wrapped-0.0.2 |
Resolved discrepancy between the target namespace definition in the WSDL and the actual returned namespace in the web service response. Changes are applicable to the following APIs: All |
JobService-0.0.4 JobService-wrapped-0.0.4 |
SvcJobExt SvString jobDescription - Description for the job SvString sendToDeviceDate - When the job has to be sent to the device SvInvoiceDetail invoiceDetail - Invoice details for the job Changes are applicable to the following APIs: SvString jobDescription and sendToDeviceDate are used in createJobs/updateJobs/createOrUpdateJobs All are used in 'get' calls: getJobs/getJobsByDivision/getUpdatedActions/getUpdatedActionsByDivision/getJobActions/ getJobActionsByDivision/getJobByReferenceNumber |
JobService-0.0.3 JobService-wrapped-0.0.3 |
SvcJob SvString dispatcherId - Not Applicable; SvString serviceOrganizationId - Not Applicable; SvDate createdDateTime - Job creation time; SvDate rejectedDateTime - it will return the date and time when the job has been rejected; SvString rejectReason - it will return the rejected reason if the job has been rejected; SvString suspendedTime - it provides the total suspended (break) time for the job; SvString timeOnJob - it provides the total actual time spent by the worker to perform the job; SvString totalTime - it provides the total time taken to complete the job (including break time); SvString jobPattern - indicates if it is a One Time Job or Always Available Job; SvString connectionId - Not Applicable; SvString emailId - email contact for the job; SvString jobStatus - status of the job; SvString jobDetailsURL - URL to the job Details PDF; Changes are applicable to the following APIs: getJobs/getJobsByDivision/getUpdatedActions/getUpdatedActionsByDivision/getJobActions/ getJobActionsByDivision/ getJobByReferenceNumber |
JobService-0.0.5 JobService-wrapped-0.0.5 |
SvInvoiceDetail5 Double taxRate - renamed to taxCost in Invoice details (aggregation of tax for the job) SvInvoicePartsDetail5 Double taxRate - tax per part Boolean labor - Indicates the part is of type labor or not Changes are applicable to the following APIs: getJobs/getJobsByDivision/getUpdatedActions/getUpdatedActionsByDivision/getJobActions/ getJobActionsByDivision/ getJobByReferenceNumber |
JobService-0.0.6 JobService-wrapped-0.0.6 |
There is no change in the WSDL compared to the 0.0.5 version. The only change is that all the 'get' call responses will have http URL for the image, instead of image included as a binary string in xml. When the image is converted to binary string the size of each image increases by 30%. When there are lot of images, the response size will grow huge, which results in the increase of response time or call timeout. The web service client can use HTTP library to download all the images in the Webservice response in batch. Use your Webservice username/password to download the image. Throttling The max image download limit per minute is 30. If client exceeds the image download limit, it will receive ‘Media download threshold per minute exceeded 30’ message with HTTP code 403. Client has to wait till end of the minute and can continue downloading the image again. fieldValue fieldValue in SvFormField returns http URL instead of binary if it is a picture. Changes are applicable to the following APIs: getJobs/getJobsByDivision/getUpdatedActions/getUpdatedActionsByDivision/getJobActions/ getJobActionsByDivision/ getJobByReferenceNumber |
createJobs
The JobWebService v0.0.1 and v0.0.2 take in an array of objects of type (SvJob).
The JobWebService v0.0.3 takes in an array of objects of type (SvcJob).
The JobWebService v0.0.4 takes in an array of objects of type (SvcJobExt) and jobWebService v0.0.5 takes in an array of objects of type (SvcJob5).
The jobWebService v0.0.6 takes in an array of objects of type (SvcJob6).
The v0.0.4/v0.0.5/v0.0.6 accepts job description.
Description
This web service call creates jobs in the StreetSmart system. In each call, 1-100 jobs can be submitted. If there are more than 100 jobs, then it can be submitted with multiple calls. If a call has more than 100 jobs then, the additional jobs will be ignored and an error code and message will be returned for these extra jobs. The new (SvJob/SvcJob/SvcJobExt/SvcJob5/ SvcJob6) object is similar to the deprecated SvWorkItem object but provides the ability to allow callers to do differential updates (see UpdateJobs web service). If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date and persisted.
An error condition in one job does not prevent other jobs from being created. If one job in a set of 3 has a validation error, then the SvJobServiceResult object for that job will indicate the error; the other two jobs will still be created.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
jobs |
SvJob[]- JobWebService v0.0.1 and v0.0.2 SvcJob[] - JobWebService v0.0.3 SvcJobExt[] - JobWebService v0.0.4 SvcJob5[] - JobWebService v0.0.5 SvcJob6[] - JobWebService v0.0.6
|
No |
Set of jobs that are to be created. Array can have at least 1 job and max 100 jobs in a call.
|
Return Result |
SvJobServiceResult[] |
No |
An array of SvJobServiceResult objects indicating success or failure for each job. The size of the returned array will be the same as the size of the input array; there will be one resulting object for each input job object. |
Validation Errors
“The input job array is null.” – Thrown if the input SvJob array is null.
“The input job array is empty.” – Thrown if the input SvJob array is input.
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number on the SvJob object is blank or null.
“CreateJob called with a reference number that already exists in the system.” – Returned if the reference number specified already exists.
“The reference number must be less than 95 characters in length.” – Returned if a reference number is greater than 95 characters in length.
“The job description (Job Name) must be less than 300 characters in length.” – Returned if the job description (Job Name) is greater than 300 characters in length.
“The work item type name is required for job create.” – Returned if the work item (Job type) type name is empty in the SvJob object.
“The work item type specified in job create was not found.” – Returned if the work item type name is valued but is not a valid work item type name.
“The priority is required for job create.” – Returned if the priority is empty on the SvJob object.
“The priority name specified in job create was not found.” – Returned if the priority is not empty but is not a valid priority.
“The worker specified in job create was not found.” – Returned if the workerName cannot be found in the system.
“The division specified in job create was not found.” – Returned if the divisionName cannot be found in the system.
“Scheduled start must be before scheduled end.” – Returned if the scheduledStartTime field is later than the scheduledEndTime field.
“Cannot input actual start or actual end on job create.” – Returned if the actualStartTime or actualEndTime fields are populated.
“Actions are not supported.” – Returned if any actions are input.
"Only 100 jobs can be processed in a single request. Additional jobs were ignored." – Returned if the user inputs more than 100 jobs.
“The description (Job Name) must be populated” – Returned when the Job Type has a mandatory Job Name field.
Error Messages (on the SvResult object - (JobWebService v0.0.3))
“Cannot set rejected date/time and/or reject reason on the job” - thrown if trying to set the rejected date and time or rejected reason.
“Cannot assign worker to a rejected job “- thrown if trying to assign worker to a rejected job.
“Specified service organization id does not exist.” - thrown if the service organization id doesn’t belong to the company.
“Specified emailID is not valid” - thrown if the email id is not in a valid format.
Error Messages (on the SvResult object -Validation Erros(JobWebService v0.0.4))
“Send to device date should not be after scheduled start time”
“Send to device date should not be in past”
“Send to device date should not be after scheduled end time”
“Description should not exceed 2000 characters”
SvJob, SvcJob and SvcJobExt, SvcJob5, SvcJob6 Required Fields
The following fields are required for job create: ReferenceNumber, WorkItemTypeName, and Priority. If the status is specified it will be used but may be overridden by a system calculated status.
createJob
(SvJob job)
Description
This web service allows the creation of a single job in the StreetSmart system. The reference number must be populated and must not already exist in the StreetSmart system. If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
job |
SvJob |
No |
The job that will be created. |
Return Result |
SvJobServiceResult |
No |
An SvJobServiceResult object indicating success or failure for the job |
Validation Errors
“The input job object is null.” – Thrown if the input SvJob object is null.
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number on the SvJob object is blank or null.
“CreateJob called with a reference number that already exists in the system.” – Returned if the reference number specified already exists.
“The reference number must be less than 95 characters in length.” – Returned if a reference number greater than 95 characters in length.
“The job description (Job Name) must be less than 300 characters in length.” – Returned if the job description (Job Name) is greater than 300 characters in length.
“The work item type name is required for job create.” – Returned if the work item (job type) type name is empty on the SvJob object.
“The work item type specified in job create was not found.” – Returned if the work item type name is not a valid work item type name.
“The priority is required for job create.” – Returned if the priority is empty on the SvJob object.
“The priority name specified in job create was not found.” – Returned if the priority is not a valid priority.
“The worker specified in job create was not found.” – Returned if the username specified in the workerName cannot be found.
“The division specified in job create was not found.” – Returned if the divisionName cannot be found.
“Scheduled start must be before scheduled end.” – Returned if the scheduledStartTime field is later than the scheduledEndTime field.
“Cannot input actual start or actual end on job create.” – Returned if the actualStartTime or actualEndTime fields are populated.
“Actions are not supported.” – Returned if any actions are input.
"Only 100 jobs can be processed in a single request. Additional jobs were ignored." – Returned if the user inputs more than 100 jobs.
SvJob Required Fields
The following fields are required for job create: ReferenceNumber, WorkItemTypeName, and Priority. If the status is specified it will be used but may be overridden by the system calculated status.
updateJobs
The JobWebService v0.0.1 and v0.0.2 takes in an array of objects of type (SvJob). The JobWebService v0.0.3 takes in an array of objects of type (SvcJob). The JobWebService v0.0.4 takes in an array of objects of type (SvcJobExt) and jobWebService v0.0.5 takes in an array of objects of type (SvcJob5). The JobWebService v0.0.6 takes in an array of objects of type (SvcJob6).
The v0.0.4/ v0.0.5/0.0.6 accept job description.
Description
This web service enables updating jobs in the StreetSmart system. This method uses the new SvJob object as input. If the reference number of a job is not in the database, then an error is returned to the caller. If over 100 jobs are input to be updated, the additional jobs will be ignored and an error code and error message will be returned for these extra jobs. If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date.
Ignorable Values versus Null Values: The caller will be able to specify that certain values in the SvJob object should be ignored and the current value in the database maintained. This will allow a caller to choose which fields should be updated. Each field in the SvJob object is “wrapped” by a container object. For example the SvString holder object contains a single String as a value. To set the job description, the value string within the jobDescription SvString object will be set to the description. If the server is not to update the description, then the container SvString object should be set to null. See the SvJob documentation for more details.
Location updates: The ability to specify that a value is to be ignored only applies to the first level of the object graph. If the location field is non-null then the job's location is updated fully with the values of the SvLocation object and any null values in the SvLocation object cause null or empty values to be inserted in the database. For example if the address field is null, any address currently existing in the database will be removed.
Attribute updates:
On a job update, only the attributes that are supplied in the input attribute array will be modified. Any other attributes will be untouched. If an attribute is specified in the input array that is not currently created for the job, that attribute will be added to the job.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
jobs |
SvJob[]- JobWebService v0.0.1 and v0.0.2 SvcJob[] - JobWebService v0.0.3 SvcJobExt[] - JobWebService v0.0.4 SvcJob5[] - JobWebService v0.0.5 SvcJob6[] - JobWebService v0.0.6
|
No |
Set of jobs that will be updated. |
Return Result |
SvJobServiceResult[] |
No |
An array of SvResult objects indicating success or failure for each job. The size of the return array will be the same as the size of the input array; there will be one result object for each input job object |
Validation Errors
“The input job array is null.” – Thrown if the input SvJob array is null.
“The input job array is empty.” – Thrown if the input SvJob array is empty.
Note: Unassigning a job from a worker through updateJob is not possible, you need to use either assignJob or removeWorkerFromJob.
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number on the SvJob object is blank or null.
“UpdateJob called with a reference number that does not exist in the system.” – Returned if the reference number specified does not exist.
“The reference number must be less than 95 characters in length.” – Returned if a reference number is greater than 95 characters in length.
“The job description (Job Name) must be less than 300 characters in length.” – Returned if the job description (Job Name) is greater than 300 characters in length.
“Actions are not supported.” – Returned if any actions are input.
“Different job type than original not allowed.” – Returned if the workItemTypeName input on job update is different than the job type that the job was created under.
“The worker specified in job update was not found.” – Returned if the worker assigned to the job could not be found.
“The division specified in job update was not found.” – Returned if the division specified was not found.
“The priority name specified in job update was not found.” – Returned if the priority name was not found.
“Actual start must be before actual end if they are input.” – Returned if the actual end time is before the actual start time.
“Cannot set the deleted datetime on job create or job update.” – Returned if the deleted datetime field is populated.
"Only 100 jobs can be processed in a single request. Additional jobs were ignored." – Returned if the user inputs more than 100 jobs.
Error Messages (on the SvResult object - JobWebService v0.0.3)
“The service organization id should not exceed 100 characters.” thrown if the service organization id is longer than 100 characters.
“Cannot set rejected date/time and/or reject reason on the job.” thrown if trying to set the reject date time or reject reason.
“Cannot assign worker to a rejected job “- thrown if trying to assign worker to a rejected job.
“Specified service organization id does not exist.” - thrown if the service organization id doesn’t belong to the company.
“The Dispatcher id should not exceed 100 characters.” - thrown if the dispatcher id is more than 100 characters.
“The service organization id must be populated. “ - thrown if the service organization is not specified.
“Specified emailID is not valid” - thrown if the email id is not in a valid format.
Error Messages (on the SvResult object - JobWebService v0.0.4)
“Description should not exceed 2000 characters” – Returned if the description is longer than 2000 characters.
“Job is already downloaded. Cannot set Send to device date” – Returned if the job is already retrieved on device.
“Send to device date should not be in past” – Returned if the send to device date is in the past.
“Send to device date should not be after scheduled start time” – Returned if the send to device date is earlier than the scheduled start time.
“Send to device date should not be after scheduled end time” – Returned if the send to device date is after the scheduled end time.
SvJob ,SvcJob , SvcJobExt,SvcJob5,SvcJob6 Required Fields
The only field that is required for updateJobs is the ReferenceNumber.
updateJob
(SvJob job)
Description
This web service allows to update a single job in the StreetSmart system. The reference number must be populated and must exist in the StreetSmart system. See the description of updateJobs for more information on how differential updates are implemented. If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
job |
SvJob- JobWebService v0.0.1 and v0.0.2 |
No |
Job that is to be updated. |
Return Result |
SvJobServiceResult |
No |
An SvJobServiceResult object indicating success or failure of the update. |
Validation Errors
“The input job object is null.” – Thrown if the input SvJob object is null.
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number on the SvJob object is blank or null.
“UpdateJob called with a reference number that does not exist in the system.” – Returned if the reference number specified does not exist.
“The reference number must be less than 95 characters in length.” – Returned if a reference number is greater than 95 characters in length.
“The job description (Job Name) must be less than 300 characters in length.” – Returned if the job description (Job Name) is greater than 300 characters in length.
“Actions are not supported.” – Returned if any actions are input.
“Different job type than original not allowed.” – Returned if the workItemTypeName input on job update is different than the job type that the job was created under.
“The worker specified in job update was not found.” – Returned if the worker to assign the job to could not be found.
“The division specified in job update was not found.” – Returned if the division specified was not found.
“The priority name specified in job update was not found.” – Returned if the priority name was not found.
“Actual start must be before actual end if they are input.” – Returned if the actual end time is before the actual start time.
“Cannot set the deleted datetime on job create or job update.” – Returned if the deleted datetime field is populated.
"Only 100 jobs can be processed in a single request. Additional jobs were ignored." – Returned if the user inputs more than 100 jobs.
SvJob Required Fields
The only field that is required for updateJobs is the ReferenceNumber.
createOrUpdateJobs
The JobWebService v0.0.1 and v0.0.2 takes in an array of objects of type (SvJob). The JobWebService v0.0.3 takes in an array of objects of type (SvcJob). The JobWebService v0.0.4 takes in an array of objects of type (SvcJobExt) and JobWebService v0.0.5 takes in an array of objects of type (SvcJob5). The v0.0.6 takes in an array of objects of type (SvcJob6). The v0.0.4/v0.0.5/v0.0.6 accept job description.
Description
This Web Service will do the work of determining whether or not each job is to be created or updated. If the reference number already exists in the database, then the job will be updated. Otherwise the job will be created. This Web Service will call into the same code as the createJob or updateJob web services. It is provided primarily as a convenience to our clients. If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date and persisted.
Note: Unassigning a job from a wroker through updateJob is not possible, you need to use either assignJob or removeWorkerFromJob API.
createOrUpdateJob
(SvJob job)
Description
This Web Service will do the work of determining whether or not the job needs to be created or updated. If the reference number already exists in the database, then the job will be updated. Otherwise the job will be created. This Web Service will call the same code as the createJob or updateJob web service methods. If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date.
createOrUpdateJobs2
(SvJobExt job)
Description
This Web Service will do the work of determining whether or not the job is to be created or updated. If the reference number already exists in the database, then the job will be updated. Otherwise, the job will be created. This Web Service will call into the same code as the createOrUpdateJobs web service method with extra feature, which will provide the option for creating location.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
job |
SvJobExt |
No |
Job that is to be updated. |
Return Result |
SvJobServiceResult |
No |
An SvJobServiceResult object indicating success or failure of the update. |
getJobByReferenceNumber
(String referenceNumber)
Description
The getJobByReferenceNumber service method provides the ability to retrieve a single job from the StreetSmart system.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The reference number of the job to retrieve. |
Return Result |
SvJob- JobWebService v0.0.1 and v0.0.2 SvcJob - JobWebService v0.0.3 SvcJobExt - JobWebService v0.0.4 SvcJob5 - JobWebService v0.0.5 SvcJob6 - JobWebService v0.0.6 |
No |
The job object which was retrieved. Attributes and actions on the job will also be returned. If a job with the corresponding reference number is not found, null is returned. |
Validation Errors
“The reference number must be populated.” – thrown if the reference number is null or blank
getJobs
The JobWebService v0.0.1 and v0.0.2 take objects SvDate, SvDateHolder, boolean, boolean
The JobWebService v0.0.3, 0.0.4, 0.0.5 and 0.0.6 take objects SvDate, SvDateHolder, boolean , boolean ,String , String
Description
The getJobs service method provides the ability to retrieve Jobs from StreetSmart that have been changed, created or deleted within a specified time range. Examples of changes include status updates from devices (worker performed actions), worker assignment or un-assignment, and updates to the job information such as the scheduled time or duration. Setting the includeAttributes and includeActions flags to false will minimize the length of time it takes the call to return.
Method Signature
Ordinal |
DataType |
Cab be Null? |
Description |
---|---|---|---|
StartDate
|
SvDate |
No |
Starting date for the range to check for changes. Starting date is inclusive. |
EndDate |
SvDateHolder
|
No |
Ending date for the range to check for changes. Ending date is exclusive. The end date is adjusted if the date passed to the web service is later than the current database time. This value is then returned to the caller. |
IncludeAttributes |
Boolean |
No |
Indicates whether or not to query for job attribute changes. If false, job attributes will also not be returned in the SvJob object. |
IncludeActions |
Boolean |
No |
Indicates whether or not to query for job action changes. If false, job actions will also not be returned in the SvJob object. |
dispatcherId |
String - JobWebService v0.0.3 and above |
Yes |
Gets the jobs of the given dispatcher |
serviceOrganizationId |
String - JobWebService v0.0.3 and above
|
Yes |
Gets the jobs of the given service organization |
Return Result |
SvJob[] - JobWebService v0.0.1 and 0.0.2 SvcJob []- JobWebService v0.0.3 SvcJobExt[]- JobWebService v0.0.4 SvcJob5[]- JobWebService v0.0.5 SvcJob6[]- JobWebService v0.0.6 |
No |
Returns an array of SvJob /SvcJob/SvcJobExt objects. This array can be empty (length=0) if no changes occurred within the specified interval, but it will not return null. |
Validation Errors
“The start date cannot be null.” – thrown if the start date is null
“The end date cannot be null.” – thrown if the end date is null
“The end date must be after the start date.” – thrown if the start date is after the end date.
“You are only allowed to query for 7 days of data at a time.” – thrown if an attempt is made to query for more than 7 days of data.
“Media size exceeded max allowed bytes of 524288000.” – thrown if the total size of all the images returned in a single API call exceeds 500 MB. Reduce date range and try again.
getJobsByDivision
The JobWebService v0.0.1 and v0.0.2 take objects SvDate, SvDateHolder, boolean, boolean , SvDivision[]
The JobWebService v0.0.3, 0.0.4, 0.0.5 and 0.0.6 take objects SvDate, SvDateHolder, boolean, boolean, SvDivision[], String , String
Description
The getJobsByDivision service method provides the ability to retrieve Jobs from StreetSmart that have been changed, created or deleted within a specified time range and belong to one of the input divisions. It has the same behavior as the getJobs service method but allows filtering by division. If a null or empty divisions array is input then all divisions are searched.
Method Signature
Ordinal |
Data Type |
Can be Null? |
Description |
---|---|---|---|
StartDate |
SvDate |
No |
Starting date for the range to check for changes. Starting date is inclusive. |
EndDate |
SvDateHolder |
No |
Ending date for the range to check for changes. Ending date is exclusive. The end date is adjusted if the date passed to the web service is later than the current database time. This value is then returned to the caller. |
IncludeAttributes |
Boolean |
No |
Indicates whether or not to query for job attribute changes. If false, job attributes will also not be returned in the SvJob object. |
IncludeActions |
Boolean |
No |
Indicates whether or not to query for job action changes. If false, job actions will also not be returned in the SvJob object. |
Divisions |
SvDivision[] |
Yes |
List of divisions for which to return job actions. |
dispatcherId |
String - JobWebService v0.0.3 and above |
Yes |
Gets the jobs of the given dispatcher |
serviceOrganizationId |
String - JobWebService v0.0.3 and above |
Yes |
Gets the jobs of the given service organization |
Return Result |
SvJob[] - JobWebService v0.0.1 and 0.0.2 SvcJob []- JobWebService v0.0.3 SvcJobExt []- JobWebService v0.0.4 SvcJob5 []- JobWebService v0.0.5 SvcJob6 []- JobWebService v0.0.6 |
No |
Returns an array of SvJob objects. This array can be empty (length=0) if no changes occurred within the specified interval, but it will not return null. |
Validation Errors
“The start date cannot be null.” – thrown if the start date is null
“The end date cannot be null.” – thrown if the end date is null
“The end date must be after the start date.” – thrown if the start date is after the end date.
“You are only allowed to query for 7 days of data at a time.” – thrown if an attempt is made to query for more than 7 days of data.
“Media size exceeded max allowed bytes of 524288000.” – thrown if total size of all the images returned in a single API call exceeds 500 MB. Reduce date range or number of divisions and try again.
assignWorkerToJob
(String referenceNumber, String workerName)
Description
The assignWorkerToJob service method provides the ability to assign a worker to a job. The referenceNumber and workerName must be unique within the company.
Note that if a job has been completed, additional assignments are ignored.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The referenceNumber of the job |
workerName |
String |
No |
The username of the worker who will be assigned to the job. |
Return Result |
SvResult |
No |
The result object. Any errors in assigning the job are indicated in the SvResult object. |
Error Messages (on the SvResult object)
“The worker with the following name is already assigned to the job: <workerName>.” – Returned if the worker is already assigned to the job.
“The reference number must be populated.” – Returned if the reference number parameter is blank.
“The reference number supplied does not exist in the system. Reference number: <referenceNumber>” – Returned if a job with the supplied reference number cannot be found.
“The worker name must be populated.” – Returned if the worker name parameter is blank.
“The worker with the following name was not found: <workerName>.” – Returned if a user with the supplied worker name cannot be found.
unassignJob
(String referenceNumber)
Description
The unassignJob service method provides the ability to remove the active assignment from a job. The referenceNumber must be unique within the company.
Jobs which are completed will not be affected by unassignment.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The referenceNumber of the job. |
Return Result |
SvResult |
No |
The result object. Any errors in unassigning the job are indicated in the SvResult object. |
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number parameter is blank.
“The reference number supplied does not exist in the system. Reference number: <referenceNumber>” – Returned if a job with the supplied reference number cannot be found.
removeWorkerFromJob
(String referenceNumber, String workerName)
Description
The removeWorkerFromJob service method provides the ability to unassign a worker from a job. It is different from the unassignJob method as it checks that the worker input is actually assigned to the job before removing the worker assignment. The worker name and the reference number must be unique within the company. Jobs which are completed will not be affected.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The referenceNumber of the job. |
workerName |
String |
No |
The username of the worker who will be unassigned from the job. |
Return Result |
SvResult[] |
No |
The result object. Any errors in removing the worker from the job are indicated in the SvResult object. |
Error Messages (on the SvResult object)
“The worker with the following name is not currently assigned to the job: <workerName>.” – Returned if the worker is not assigned to the job.
“The reference number must be populated.” – Returned if the reference number parameter is blank.
“The reference number supplied does not exist in the system. Reference number: <referenceNumber>” – Returned if a job with the supplied reference number cannot be found.
“The worker name must be populated.” – Returned if the worker name parameter is blank.
“The worker with the following name was not found: <workerName>.” – Returned if a user with the supplied worker name cannot be found.
deleteJob
(String referenceNumber)
Description
The deleteJob method provides the ability to unconditionally delete a job regardless of its current status. The referenceNumber must be unique within the company.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The referenceNumber of the job |
Return Result |
SvResult |
No |
The result object. Any errors in deleting the job are indicated in the SvResult object. |
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number parameter is blank.
“The reference number supplied does not exist in the system. Reference number: <referenceNumber>” – Returned if a job with the supplied reference number cannot be found.
terminateJob
(String referenceNumber, SvDate completionDateTime)
Description
The terminateJob method provides the ability to unconditionally terminate (complete) a job. The actual end time on the job will be set to the time supplied (or the system time if no end time is supplied) and the job status will be set to "Terminated". If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date and persisted.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The referenceNumber of the job |
completionDateTime |
SvDate |
Yes |
The time to use as the completion time on the job. If null, then the StreetSmart system time is used. |
Return Result |
SvResult |
No |
The result object. Any errors in terminating the job are indicated in the SvResult object. |
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number parameter is blank.
“The reference number supplied does not exist in the system. Reference number: <referenceNumber>” – Returned if a job with the supplied reference number cannot be found.
terminateJobForWorker
(String referenceNumber, String workerName, SvDate completionDateTime)
Description
The terminateJobForWorker method provides the ability to unconditionally terminate (complete) a job. The actual end time on the job will be set to the time supplied (or the system time if no end time is supplied) and the job status will be set to "Terminated". This method differs from the terminateJob method: it checks that the worker is actually assigned to the job before terminating the job. The worker name and the reference number must be unique within the company. If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date and persisted.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The referenceNumber of the job |
workerName |
String |
No |
The username of a worker in StreetSmart. |
completionDateTi me |
SvDate |
Yes |
The time to use as the completion time on the job. If null, then the StreetSmart system time is used. |
Return Result |
SvResult |
No |
The result object. Any errors in terminating the job are indicated in the SvResult object. |
Error Messages (on the SvResult object)
“The worker with the following name is not currently assigned to the job:<workerName>.”– Returned if the worker is not assigned to the job.
“The reference number must be populated.” – Returned if the reference number parameter is blank.
“The reference number supplied does not exist in the system. Reference number: <referenceNumber>” – Returned if a job with the supplied reference number cannot be found.
“The worker name must be populated.” – Returned if the worker name parameter is blank.
“The worker with the following name was not found: <workerName>.” – Returned if a user with the supplied worker name cannot be found.
restoreJob
(String referenceNumber)
Description
The restoreJob method provides the ability to restore (undelete) a job which has previously been deleted. The job will be restored in the same state as when it was deleted.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber |
String |
No |
The reference Number of the job |
Return Result |
SvResult |
No |
The result object. Any errors in restoring the job are indicated in the SvResult object. |
Error Messages (on the SvResult object)
“The reference number must be populated.” – Returned if the reference number parameter is blank.
“The reference number supplied does not exist in the system. Reference number: <referenceNumber>” – Returned if a job with the supplied reference number cannot be found.
getUpdatedActionsByDivision
(SvDate start, SvDateHolder end, SvDivision[] divisions)
Description
The getUpdatedActionsByDivision service method provides the ability to retrieve job actions from StreetSmart that have been created or changed within a specified time range. Only changed actions are returned, the accumulated set of actions that have been performed can only be returned by retrieving the job itself. Actions are returned in the order that they were performed.
Method Signature
Ordinal |
Data Type |
Can be Null? |
Description |
---|---|---|---|
StartDate |
SvDate |
No |
Starting date for the range to check for changes. Starting date is inclusive. |
EndDate |
SvDateHolder |
No |
Ending date for the range to check for changes. Ending date is exclusive. The end date is adjusted if the date passed to the web service is later than the current database time. This value is then returned to the caller. |
Divisions |
SvDivision[] |
Yes |
List of divisions for which to return job actions. The query is restricted to only returning these divisions. |
Return Result |
SvJobActionUpdate[] - JobWebService v0.0.1 and 0.0.2 SvcJobActionUpdate[]- JobWebService v0.0.3 SvcJobExtActionUpdate[]- JobWebService v0.0.4 and above |
No |
Returns an array of SvJobActionUpdate / SvcJobActionUpdate / SvcJobExtActionUpdate objects. This array can be empty (length=0) if no changes occurred within the specified interval, but it will not return null. |
The intended usage of this service call is to provide a way to periodically synchronize an external system’s data with StreetSmart. The external system is expected to call this service incrementally using adjacent time ranges such as:
Call 1: 2004-01-28 13:50:00.0000 to 2004-01-28 14:52:00.000
Call 2: 2004-01-28 14:52:00.0000 to 2004-01-28 15:49:07.000
Call 3: 2004-01-28 15:49:07.0000 to 2004-01-28 16:55:43.000
The external system must keep track of the last call’s endTime and should use the last endTime as the startTime for the next call. The results returned are inclusive on the startTime and exclusive on the endTime to prevent the returned results from overlapping between two adjacent calls.
Expected behaviors
- If no changes are detected for any WorkItems, an empty array is returned.
- If either the start or end time and date parameters are null, an exception is thrown.
- If the endDate is equal to or before the startData, an exception is thrown.
Validation Errors
“The start date cannot be null.” – thrown if the start date is null
“The end date cannot be null.” – thrown if the end date is null
“The end date must be after the start date.” – thrown if the start date is after the end date.
“You are only allowed to query for 7 days of data at a time.” – thrown if an attempt is made to query for more than 7 days of data.
“Media size exceeded max allowed bytes of 524288000.” – thrown if total size of all the images returned in a single API call exceeds 500 MB. Reduce date range or number of divisions and try again.
getUpdatedActions
(SvDate start, SvDateHolder end)
Description
The getUpdatedActions method functions the same as the getUpdatedActionsByDivision method but does not filter the result by division. All updated actions within the company are returned.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
StartDate |
SvDate |
No |
Starting date for the range to check for changes. Starting date is inclusive. |
EndDate |
SvDateHolder |
No |
Ending date for the range to check for changes. Ending date is exclusive. The end date must be a UTC date. The end date is adjusted if the date passed to the web service is later than the current database time. This value is then returned to the caller. |
Return Result |
SvJobActionUpdate[] - JobWebService v0.0.1 and 0.0.2 SvcJobActionUpdate[]- JobWebService v0.0.3 SvcJobActionUpdateExt[]- JobWebService v0.0.4 and above |
No |
Returns an array of SvJobActionUpdate / SvcJobActionUpdate / SvcJobExtActionUpdate objects. This array can be empty (length=0) if no changes occurred within the specified interval, but it will not return null. |
Validation Errors
“The start date cannot be null.” – thrown if the start date is null
“The end date cannot be null.” – thrown if the end date is null
“The end date must be after the start date.” – thrown if the start date is after the end date.
“You are only allowed to query for 7 days of data at a time.” – thrown if an attempt is made to query for more than 7 days of data.
“Media size exceeded max allowed bytes of 524288000.” – thrown if total size of all the images returned in a single API call exceeds 500 MB. Reduce date range and try again.
getJobActionsByDivision
(SvDate start, SvDateHolder end, SvDivision[] divisions)
Description
The getJobActionsByDivision service method provides the ability to retrieve job actions from StreetSmart that have been created within a specified time range. Only new created actions are returned, the accumulated set of actions that have been performed can only be returned by retrieving the job itself. Actions are returned in the order that they were performed.
Method Signature
Ordinal |
Data Type |
Can be Null? |
Description |
---|---|---|---|
StartDate |
SvDate |
No |
Starting date for the range to check for changes. Starting date is inclusive. |
EndDate |
SvDateHolder |
No |
Ending date for the range to check for changes. Ending date is exclusive. The end date must be a UTC date. The end date is adjusted if the date passed to the web service is later than the current database time. This value is then returned to the caller. |
Divisions |
SvDivision[] |
Yes |
List of divisions for which job actions will be returned. |
Return Result |
SvJobActionUpdate[] - JobWebService v0.0.1 and 0.0.2
SvcJobActionUpdate[]- JobWebService v0.0.3 SvcJobActionUpdateExt[]- JobWebService v0.0.4 and above |
No |
Returns an array of SvJobActionUpdate / SvcJobActionUpdate / SvcJobExtActionUpdate objects. This array can be empty (length=0) if no new job actions were created within the specified interval, but it will not return null. |
The intended usage of this service call is to provide a way to periodically synchronize an external system’s data with StreetSmart. The external system is expected to call this service incrementally using adjacent time ranges such as:
Call 1: 2004-01-28 13:50:00.0000 to 2004-01-28 14:52:00.000
Call 2: 2004-01-28 14:52:00.0000 to 2004-01-28 15:49:07.000
Call 3: 2004-01-28 15:49:07.0000 to 2004-01-28 16:55:43.000
The external system must keep track of the last call’s endTime and should use the last endTime as the startTime for the next call. The results returned are inclusive on the startTime and exclusive on the endTime to prevent the returned results from overlapping between two adjacent calls.
Expected behaviors
- If no new job actions are detected for any WorkItems, an empty array is returned.
- If either the start or end timedate parameters are null, an exception is thrown.
- If the endDate is equal to or before the startData, an exception is thrown.
Validation Errors
“The start date cannot be null.” – thrown if the start date is null
“The end date cannot be null.” – thrown if the end date is null
“The end date must be after the start date.” – thrown if the start date is after the end date.
“You are only allowed to query for 7 days of data at a time.” – thrown if an attempt is made to query for more than 7 days of data.
“Media size exceeded max allowed bytes of 524288000.” – thrown if total size of all the images returned in a single API call exceeds 500 MB. Reduce date range or number of divisions and try again.
getJobActions
(SvDate start, SvDateHolder end)
Description
The getJobActions method functions the same as the getJobActionsByDivision method but it does not filter the result by division. All newly created job actions within the company are returned.
Method Signature
Ordinal |
Data Type |
Can be Null? |
Description |
---|---|---|---|
StartDate |
SvDate |
No |
Starting date for the range to check for changes. Starting date is inclusive. |
EndDate |
SvDateHolder |
No |
Ending date for the range to check for changes. Ending date is exclusive. The end date is adjusted if the date passed to the web service is later than the current database time. This value is then returned to the caller. |
Return Result |
SvJobActionUpdate[] - JobWebService v0.0.1 and 0.0.2 SvcJobActionUpdate[]- JobWebService v0.0.3 SvcJobExtActionUpdate[]- JobWebService v0.0.4 and above |
No |
Returns an array of SvJobActionUpdate / SvcJobActionUpdate / SvcJobExtActionUpdate objects. This array can be empty (length=0) if no new job actions were created within the specified interval, but it will not return null. |
Validation Errors
“The start date cannot be null.” – thrown if the start date is null
“The end date cannot be null.” – thrown if the end date is null
“The end date must be after the start date.” – thrown if the start date is after the end date.
“You are only allowed to query for 7 days of data at a time.” – thrown if an attempt is made to query for more than 7 days of data.
“Media size exceeded max allowed bytes of 524288000.” – thrown if total size of all the images returned in a single API call exceeds 500 MB. Reduce date range and try again.
assignWorkerAndUpdateJob
(String workerName, SvJob svJob)
Description
This method is available in the wsdl but will throw an exception if called. It is not supported for general usage. It is possible to assign a worker during the updateJob method call by setting the workerName property. If actual start date and/or actual end date is provided for a job, the actual duration is computed as the difference of actual start and end date and persisted.
Method Signature:
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
workername |
string |
No |
The name of the worker to assign to the job |
svJob |
SvJob |
No |
Array of jobs. |
Return Result |
SvResult |
No |
SvResult object that indicates the success or failure of the method call. |
cancelJobs
The JobWebService v0.0.3 and above takes in a list of objects (String[] referenceNumbers)
Description
The cancelJobs service method provides the ability to cancel the job. The referenceNumber should be unique with the company and jobs that are deleted will not get canceled. Canceled jobs can be viewed by the user but the job status cannot be changed.
Method Signature
Ordinal |
DataType |
Can be Null? |
Description |
---|---|---|---|
referenceNumber[] |
String |
No |
The referenceNumber’s of the job |
Return Result |
SvJobServiceResult |
No |
The result object. Any errors in cancelJobs are indicated in the SvJobServiceResult object |
Error Messages (on the SvJobServiceResult object)
"CancelJob called with a reference number that does not exist in the system." - Returned if the referenceNumber is not found in companies jobs or if the serviceOrganizationId associated to the job is different from the logged in serviceOrganizationId.
"Cannot cancel a deleted job" - Returned if the referenceNumber is already a deleted job in the company.
submitJobAction
(SvJobAction jobAction, String referenceNumber)
Description
This method is used to submit job actions
Method Signature:
jobAction |
SvJobAction |
Array of job actions performed for Job(s). |
referenceNumber |
String |
Job reference number. |
Return Result |
SvResult |
SvResult object that indicates the success or failure of the method call. |
JobService Error Codes
Error Code |
Description of Error |
---|---|
General Error Codes (Applies across multiple methods) |
|
0 |
Success (No Error) |
1 |
The reference number was empty. |
2 |
A job with the supplied reference number does not exist. |
3 |
The worker name was not valued. |
4 |
A worker with the supplied worker name does not exist. |
5 |
An error occurred persisting the data. The specific error message will be supplied in the SvResult message string. |
500 |
Unable to connect to the web service. |
Error codes specific to unassignment |
|
6 |
The worker is not currently assigned to the job. |
Error codes specific to assignment |
|
7 |
The worker is already assigned to the job. |
Error codes specific to job create or job update |
|
8 |
The input job object is null. |
10 |
The reference number supplied already exists. |
11 |
The work item type name is required but was not supplied. |
12 |
The work item type name supplied does not exist. |
13 |
The priority of the job is required but was not supplied. |
14 |
The priority name supplied is not a valid priority. |
15 |
The division name supplied is not a valid division. |
16 |
The scheduled start time or scheduled end time is more than 30 years in the future. |
17 |
The scheduled start time of the job is after the scheduled end time. |
18 |
The job actual start time or the job actual end time is input on job create or job update. This is not allowed. |
19 |
Actions cannot be input on job create or job update. |
20 |
The reference number supplied is more than 45 characters in length. |
21 |
Attributes required by the work item type were not present on job create. |
22 |
More than 100 jobs were input for creation or updating. |
23 |
The customer type supplied does not exist. |
24 |
The job category supplied does not exist. |
25 |
The deleted datetime field cannot be set on job create or job update. |
38 |
The Job Type has a mandatory job name field. |
Error codes specific to cancel job |
|
46 |
Cannot cancel a deleted job |
47 |
CancelJob called with a reference number that does not exist in the system. |
48 |
Canceled jobs cannot be re-assigned. |
49 |
Rejected jobs cannot be re-assigned. |
Error codes specific to job description |
|
50 |
Description should not exceed 2000 characters |
Error codes specific to send to device |
|
51 |
Send to device date should not be after scheduled start time / Send to device date should not be in past / Send to device date should not be after scheduled end time / Job is already downloaded. Cannot set Send to device date |
Comments
0 comments
Article is closed for comments.