Difference between revisions of "Get Job PDF"

From MyMobileWorkers API
Jump to: navigation, search
(→‎Summary)
Line 45: Line 45:
  
  
−
== Usage/Caching ==
+
== Usage / Caching ==
  
 
Generating PDFs via this tool can sometimes take an extended period to generate, its suggested that any PDFs generated are not streamed directly to your end users but saved on your server for downloading.
 
Generating PDFs via this tool can sometimes take an extended period to generate, its suggested that any PDFs generated are not streamed directly to your end users but saved on your server for downloading.
  
−
== Signatures ==
+
== Header / Footer ==
  
 
As with the web portal you can configure these PDFs with customer header and footers. For more information please see here
 
As with the web portal you can configure these PDFs with customer header and footers. For more information please see here
Line 56: Line 56:
  
 
''Warning: If a header or footer is configured with either broken HTML or broken IMG tags then PDF will fail to generate''
 
''Warning: If a header or footer is configured with either broken HTML or broken IMG tags then PDF will fail to generate''
 +
 +
== Optional extras  / Different report types ==
 +
 +
MyMobileWorkers has different types of exports for a job, these all use the same engine but have different views and options.
 +
 +
You can toggle which export you want to generate by setting the <code>export_id</code> flag. The default is 6 which is the "Default job export". Each export has its own set of optional flags you can pass to alter what is displayed on the report.
 +
 +
=== Default : export_id=6 ===
 +
Below is a list of optional extra GET parameters which are related specifically to this export type
 +
 +
{| border="1" class="wikitable"å
 +
|-
 +
! GET Param
 +
! Default value
 +
! Description
 +
|-
 +
! show_notes
 +
| true
 +
| Displays job notes
 +
|-
 +
! show_photos
 +
| true
 +
| Displays job photos
 +
|-
 +
! show_times
 +
| true
 +
| Display created at/updated at timestamps
 +
|-
 +
! show_pre_checks
 +
| true
 +
| Displays pre job check results
 +
|-
 +
! show_post_checks
 +
| true
 +
| Displays post job check results
 +
|-
 +
! show_advanced
 +
| false
 +
| Show Repair information (Repair jobs only)
 +
|-
 +
! show_activities
 +
| false
 +
| Displays job activities
 +
|-
 +
|}

Revision as of 14:17, 22 October 2013

Contents

Get Job PDF

The MyMobileWorkers web portal provides a tool for exporting PDFs from the job data, In some integration cases it may be easier to pull the completed job down in PDF format over importing the data into your database. This page discusses a way to allow to remotely download the same PDF's using your api key as authentication rather than having to log into the portal.

The tool provided to do this is part of the web portal and not the api, as such the URL is slightly different.

   http://live.mymobileworkers.com/api/

Its coding style is similar to API and returns the same set of error codes.

Summary

Jobs
URL http://:base_url/api/job_export?api_key=YOUR_KEY&job_number=JOB_NUMBER
Type GET
Params: api_key required
job_number required
export_id can be used to specify the export template used, please contact us for more information (default is 6)
Response PDF / JSON (on error)

Responses

In the event of a successful export generation the tool will return a 200 response, and a PDF to download.

If an error occurs the tool will return either a 401 or 500 error code. The HTTP response code should be used to decide if the PDF was generated correctly. If a 401 or 500 response is returned the headers will be of type 'application/json' and the error code structure will match the rest of the API.

{"error_code":"JBE100","error_message":"Job cannot be found."}


Usage / Caching

Generating PDFs via this tool can sometimes take an extended period to generate, its suggested that any PDFs generated are not streamed directly to your end users but saved on your server for downloading.

Header / Footer

As with the web portal you can configure these PDFs with customer header and footers. For more information please see here

[1]

Warning: If a header or footer is configured with either broken HTML or broken IMG tags then PDF will fail to generate

Optional extras / Different report types

MyMobileWorkers has different types of exports for a job, these all use the same engine but have different views and options.

You can toggle which export you want to generate by setting the export_id flag. The default is 6 which is the "Default job export". Each export has its own set of optional flags you can pass to alter what is displayed on the report.

Default : export_id=6

Below is a list of optional extra GET parameters which are related specifically to this export type

GET Param Default value Description
show_notes true Displays job notes
show_photos true Displays job photos
show_times true Display created at/updated at timestamps
show_pre_checks true Displays pre job check results
show_post_checks true Displays post job check results
show_advanced false Show Repair information (Repair jobs only)
show_activities false Displays job activities
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox