Function: Adds a job, inserts in the audit log and sends an email alert.
Web service call: https://proworkflow2.net/pwfaccountname/api/v2/jobs.cfm?customerkey=84DC6CF8-BF78-D79D-B25B-0C0D20229F17&api_call=addjob&UserID=xxx
Method: POST
XML Request Data:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <addjob>
  3. <jobassignedtostaff>x5×4x7x</jobassignedtostaff> REQUIRED FIELD
  4. <jobmanager>7</jobmanager> REQUIRED FIELD
  5. <jobassignedtocontractors>x342×18x</jobassignedtocontractors>
  6. <jobassignedtoclients>x67x</jobassignedtoclients>
  7. <jobtotaltimeallocated>2</jobtotaltimeallocated> (Time in Minutes)
  8. <jobdatestart>02-Jan-2009</jobdatestart>
  9. <jobdatedue>02-Feb-2009</jobdatedue>
  10. <jobclientid>COM34</jobclientid> REQUIRED FIELD(Use COM prefix if specifying a company or PER if specifying a person)
  11. <jobdescription>Create new website</jobdescription>
  12. <jobnumber>SA0001</jobnumber>
  13. <jobuseautonumber>yes</jobuseautonumber>
  14. <jobtitle>Website Update</jobtitle>
  15. <jobcategoryid>9</jobcategoryid>
  16. <jobinvoiced>no</jobinvoiced>
  17. <jobpaid>no</jobpaid>
  18. <jobaccountedfor>no</jobaccountedfor>
  19. <jobclientlogin>yes</jobclientlogin>
  20. <jobquotedprice>135.00</jobquotedprice>
  21. <jobinvoicedprice>78</jobinvoicedprice>
  22. <jobnotes>Sample notes</jobnotes>
  23. <jobpriority>3</jobpriority>
  24. </addjob>
URL Parameters: UserId is mandatory.
Notes: Required fields must be included, other fields can be omitted.
'currentAutoNumber' is retrieved via the CreateJobNumber call.
Return Data: XML data packet is constructed by the web service and sent to the user. It contains the success or failure message. If it is a success then a link of the job is also sent in the return data.
Status messages: Success, Failure or Error.

 

Example of return data:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <addjob>
  3. <status>Success</status>
  4. <details>
  5. <message>Click on the link to view the job. https://proworkflow2.net/pwfaccountname/index.cfm?Fuseaction=jobs&Fusesubaction=jobdetails&Jobs_currentJobID= 1042</message>
  6. <jobid>1042</jobid>
  7. </details>
  8. </addjob>
  9.  
  10. OR
  11.  
  12. <?xml version="1.0" encoding="UTF-8"?>
  13. <addjob>
  14. <status>Failure</status>
  15. <details>
  16. <message>Error: You don't have permission to perform this action.</message>
  17. </details>
  18. </addjob>
  19.  
  20. OR
  21.  
  22. <?xml version="1.0" encoding="UTF-8"?>
  23. <addjob>
  24. <status>Failure</status>
  25. <details>
  26. <message>Not a valid client</message>
  27. </details>
  28. </addjob>
VN:F [1.7.5_995]
Was this article useful?