diff --git a/.gitignore b/.gitignore index dd26b90..600b366 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,7 @@ Thumbs.db # dotCover *.dotCover -FormitizeAPI/project.lock.json +FormitizeAPI/project.lock.json + +# IDEs +.idea/ diff --git a/docs/api_data.js b/docs/api_data.js index 6710c33..4865c00 100644 --- a/docs/api_data.js +++ b/docs/api_data.js @@ -1,10 +1,31 @@ define({ "api": [ + { + "type": "delete", + "url": "/asset/:schemaID/:assetID", + "title": "Delete Asset", + "name": "AssetDelete", + "order": "5", + "description": "

Delete an existing asset.

", + "group": "Asset_Management", + "version": "1.0.0", + "success": { + "examples": [ + { + "title": "CURL Response", + "content": "{\n \"payload\": {\n \"result\": \"deleted\"\n }\n}", + "type": "JSON" + } + ] + }, + "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", + "groupTitle": "Asset_Management" + }, { "type": "post", "url": "/asset/:schemaID/", "title": "Add Asset", - "name": "AssetCreate", - "order": "3", + "name": "CreateAsset", + "order": "2", "description": "

Create an asset

", "group": "Asset_Management", "version": "1.0.0", @@ -21,7 +42,14 @@ define({ "api": [ { "group": "Body", "type": "string", - "optional": false, + "optional": true, + "field": "number", + "description": "

Asset number.

" + }, + { + "group": "Body", + "type": "string", + "optional": true, "field": "description", "description": "

description of the asset.

" }, @@ -46,6 +74,13 @@ define({ "api": [ "field": "altitude", "description": "

altitude coordinate

" }, + { + "group": "Body", + "type": "number", + "optional": true, + "field": "clientID", + "description": "

Client ID for existing client.

" + }, { "group": "Body", "type": "client", @@ -58,14 +93,14 @@ define({ "api": [ "type": "number", "optional": true, "field": "locationID", - "description": "

location ID for existing client locations.

" + "description": "

location ID for existing client location.

" }, { "group": "Body", "type": "number", "optional": true, "field": "zoneID", - "description": "

zone ID for existing client locations.

" + "description": "

zone ID for existing client location zone.

" }, { "group": "Body", @@ -74,13 +109,6 @@ define({ "api": [ "field": "zone", "description": "

Creates a new zone and attaches it to the existing client location id. If there is no location, no zone will be created.

" }, - { - "group": "Body", - "type": "number", - "optional": true, - "field": "clientID", - "description": "

client ID for existing clients

" - }, { "group": "Body", "type": "json", @@ -113,168 +141,168 @@ define({ "api": [ "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -284,17 +312,17 @@ define({ "api": [ "examples": [ { "title": "Request Body Example:", - "content": "{\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", + "content": " {\n \"name\": \"New Asset\",\n \"number\": \"ASSET01\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", "type": "json" }, { "title": "Request Body Example using schema-columns:", - "content": "{\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"content\": {\n \"Barcode ID\": \"QR-6789\",\n \"Area\": \"Bathroom\",\n \"Activity Level\": \"15\",\n \"Replenished (Yes/No)\": \"No\",\n \"Comments\": \"Quick comment.\"\n }\n}", + "content": " {\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"content\": {\n \"Barcode ID\": \"QR-6789\",\n \"Area\": \"Bathroom\",\n \"Activity Level\": \"15\",\n \"Replenished (Yes/No)\": \"No\",\n \"Comments\": \"Quick comment.\"\n }\n}", "type": "json" }, { "title": "Request Body Example with new client", - "content": "{\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"client\": {\n \"billingName\": \"New Customer\",\n \"contact\": [{\n \"firstName\": \"Alex\",\n \"lastName\": \"Jones\",\n \"email\": \"alex.jones@company.net\",\n }],\n \"location\": [{\n \"street1\": \"123 Street name\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }]\n },\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", + "content": " {\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"client\": {\n \"billingName\": \"New Customer\",\n \"contact\": [{\n \"firstName\": \"Alex\",\n \"lastName\": \"Jones\",\n \"email\": \"alex.jones@company.net\",\n }],\n \"location\": [{\n \"street1\": \"123 Street name\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }]\n },\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", "type": "json" } ] @@ -303,7 +331,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Adadress Sydney 2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n }\n }\n}", + "content": " {\n \"payload\": {\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Address Sydney NSW 2000\",\n \"address1\": \"123 Street Address\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n }\n}", "type": "JSON" } ] @@ -311,214 +339,19 @@ define({ "api": [ "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", "groupTitle": "Asset_Management" }, - { - "type": "delete", - "url": "/asset/:schemaID/:assetID", - "title": "Delete Asset", - "name": "AssetDelete", - "order": "5", - "description": "

Delete an existing asset.

", - "group": "Asset_Management", - "version": "1.0.0", - "success": { - "examples": [ - { - "title": "CURL Response", - "content": "{\n \"payload\": {\n \"result\": \"deleted\"\n }\n}", - "type": "JSON" - } - ] - }, - "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", - "groupTitle": "Asset_Management", - "parameter": { - "fields": { - "Client Fields": [ - { - "group": "Client Fields", - "type": "Object", - "optional": false, - "field": "client", - "description": "

The Client Object

" - }, - { - "group": "Client Fields", - "type": "Number", - "optional": true, - "field": "client.id", - "description": "

ID of the client.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": false, - "field": "client.billingName", - "description": "

The Billing Name of the client

" - }, - { - "group": "Client Fields", - "type": "Object[]", - "optional": true, - "field": "client.contact", - "description": "

An array of contacts

" - }, - { - "group": "Client Fields", - "type": "Number", - "optional": true, - "field": "client.contact.id", - "description": "

The ID of the client's contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.firstName", - "description": "

First name of contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.lastName", - "description": "

Last name of contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.email", - "description": "

First name of contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.mobile", - "description": "

Mobile number.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.mobileAreaCode", - "description": "

Mobile number area code.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.workPhone", - "description": "

Work phone number.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.workPhoneAreaCode", - "description": "

Work phone number area code.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.homePhone", - "description": "

Home phone number.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.homePhoneAreaCode", - "description": "

Home phone number area code.

" - }, - { - "group": "Client Fields", - "type": "Object", - "optional": true, - "field": "client.contact.custom", - "description": "

Object of custom variables.

" - }, - { - "group": "Client Fields", - "type": "Object", - "optional": true, - "field": "client.contact.custom.OBJECT_1", - "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" - }, - { - "group": "Client Fields", - "type": "Object[]", - "optional": true, - "field": "client.location", - "description": "

An array of locations

" - }, - { - "group": "Client Fields", - "type": "Number", - "optional": true, - "field": "client.location.id", - "description": "

The ID of the client's location.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.street1", - "description": "

Street 1 address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.street2", - "description": "

Street 2 address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.city", - "description": "

City address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.state", - "description": "

State address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.postcode", - "description": "

Postcode address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.country", - "description": "

Country address.

" - } - ] - } - } - }, { "type": "get", "url": "/asset/:schemaID/:assetID", "title": "Get Asset", - "name": "AssetGet", - "order": "5", + "name": "GetAsset", + "order": "3", "description": "

Get available information about the asset.

", "group": "Asset_Management", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/3/520427", "type": "json" } ], @@ -526,7 +359,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\", \n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n } \n ]\n },\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Adadress Sydney 2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n }\n }\n}", + "content": "{\n \"payload\": {\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": \"520427\",\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Address Sydney NSW 2000\",\n \"address1\": \"123 Street Address\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n }\n}", "type": "JSON" } ] @@ -536,17 +369,17 @@ define({ "api": [ }, { "type": "get", - "url": "/asset/list/:schemaID/", - "title": "List Assets", - "name": "AssetList", - "order": "2", - "description": "

Retrieve a list of assets within a schema.

", + "url": "/asset/schema/list", + "title": "List Asset Types", + "name": "ListAssetSchema", + "order": "0", + "description": "

Retrieve a list of asset schemas available.

", "group": "Asset_Management", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/:schemaID", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/", "type": "json" } ], @@ -554,27 +387,27 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\", \n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n } \n ]\n },\n \"results\": [\n {\n \"assetID\": \"520427\",\n \"name\": \"Name of asset\",\n \"description\": \"Description of asset.\",\n \"number\": \"520427\",\n \"schemaID\": \"3\",\n \"date\": \"1599094442\",\n \"latitude\": \"5556\",\n \"longitude\": \"6666\",\n \"clientID\": \"1\",\n \"altitude\": \"777\",\n \"companyName\": \"Client Name\",\n \"address1\": \"123 Street Address\",\n \"address2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n }\n ]\n }\n}", + "content": "{\n \"payload\": [\n {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"ID\",\n \"col\": \"id\"\n },\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n\t\t\t\t\"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n\t\t...\n\t]\n}", "type": "JSON" } ] }, - "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", + "filename": "app/system/class/api/rest/v1/asset/schema/_apidoc.js", "groupTitle": "Asset_Management" }, { "type": "get", - "url": "/asset/schema/list", - "title": "List Asset Types", - "name": "AssetSchemaList", + "url": "/asset/list/:schemaID/", + "title": "List Assets", + "name": "ListAssets", "order": "1", - "description": "

Retrieve a list of asset schemas available.

", + "description": "

Retrieve a list of assets within a schema.

", "group": "Asset_Management", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/3", "type": "json" } ], @@ -582,19 +415,19 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": [\n {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"ID\",\n \"col\": \"id\"\n },\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n\t\t\t\t\"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n\t\t...\n\t]\n}", + "content": "{\n \"payload\": {\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n\t\t\t\t\"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n \"results\": [\n {\n \"id\": \"520427\",\n \"companyID\": \"1\",\n \"name\": \"Name of asset\",\n \"description\": \"Description of asset.\",\n \"number\": \"520427\",\n \"schemaID\": \"3\",\n \"date\": \"1599094442\",\n \"latitude\": \"5556\",\n \"longitude\": \"6666\",\n \"clientID\": \"1\",\n \"locationID\": \"5\",\n \"altitude\": \"777\",\n \"companyName\": \"Client Name\",\n \"siteName\": \"\",\n \"address1\": \"123 Street Address\",\n \"address2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"2000\",\n \"state\": \"NSW\",\n \"country\": \"\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n ]\n }\n}", "type": "JSON" } ] }, - "filename": "app/system/class/api/rest/v1/asset/schema/_apidoc.js", + "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", "groupTitle": "Asset_Management" }, { "type": "post", "url": "/asset/:schemaID/:assetID", "title": "Edit Asset", - "name": "AssetUpdate", + "name": "UpdateAsset", "order": "4", "description": "

Update an existing asset.

", "group": "Asset_Management", @@ -605,10 +438,17 @@ define({ "api": [ { "group": "Body", "type": "string", - "optional": true, + "optional": false, "field": "name", "description": "

Name of the asset.

" }, + { + "group": "Body", + "type": "string", + "optional": true, + "field": "number", + "description": "

Asset number.

" + }, { "group": "Body", "type": "string", @@ -642,21 +482,28 @@ define({ "api": [ "type": "number", "optional": true, "field": "clientID", - "description": "

client ID for existing clients

" + "description": "

Client ID for existing client.

" + }, + { + "group": "Body", + "type": "client", + "optional": true, + "field": "client", + "description": "

Optional client body for new clients

" }, { "group": "Body", "type": "number", "optional": true, "field": "locationID", - "description": "

location ID for existing client locations.

" + "description": "

location ID for existing client location.

" }, { "group": "Body", "type": "number", "optional": true, "field": "zoneID", - "description": "

zone ID for existing client locations.

" + "description": "

zone ID for existing client location zone.

" }, { "group": "Body", @@ -665,13 +512,6 @@ define({ "api": [ "field": "zone", "description": "

Creates a new zone and attaches it to the existing client location id. If there is no location, no zone will be created.

" }, - { - "group": "Body", - "type": "client", - "optional": true, - "field": "client", - "description": "

Optional client body for new clients

" - }, { "group": "Body", "type": "json", @@ -704,168 +544,168 @@ define({ "api": [ "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -894,7 +734,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Updated Asset Name\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Adadress Sydney 2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n },\n \"fieldsUpdated\": {\n \"name\": \"Updated Asset Name\",\n \"description\": \"desc\",\n \"longitude\": \"6666\"\n },\n }\n}", + "content": "{\n \"payload\": {\n \"status\": \"success\",\n \"fieldsUpdated\": {\n \"name\": \"Updated Asset Name\",\n \"description\": \"New Description\",\n \"longitude\": \"1\"\n },\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Updated Asset Name\",\n \"number\": 520427,\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Address Sydney NSW 2000\",\n \"address1\": \"123 Street Address\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n }\n}", "type": "JSON" } ] @@ -918,14 +758,14 @@ define({ "api": [ "CURL Authorisation": [ { "group": "CURL Authorisation", - "type": "String", + "type": "string", "optional": false, "field": "--user-agent", "description": "

This is the company login name used on Formitize e.g. "Formitize"

" }, { "group": "CURL Authorisation", - "type": "String", + "type": "string", "optional": false, "field": "--u", "description": "

This will be the user:password b64 encrypted e.g. Username123:password123

" @@ -954,7 +794,7 @@ define({ "api": [ "examples": [ { "title": "Authorisation Errors", - "content": "{\"payload\":{\"error\": {\"message\": \"Username does not exist.\", \"timestamp\": 1521691072, \"code\": 401}}}", + "content": "{\n \"payload\": {\n \"error\": {\n \"message\": \"Invalid company/user/password.\",\n \"timestamp\": 1679273891,\n \"code\": 401\n }\n }\n}", "type": "json" } ] @@ -962,10 +802,10 @@ define({ "api": [ }, { "type": "Post", - "url": "/crm/client/:id/contact/", + "url": "/crm/client/:clientID/contact/", "title": "Add Contact", "name": "AddContact", - "order": "7", + "order": "6", "group": "CRM", "version": "1.0.0", "parameter": { @@ -973,84 +813,84 @@ define({ "api": [ "Contact Fields": [ { "group": "Contact Fields", - "type": "Number", + "type": "number", "optional": true, "field": "id", "description": "

The ID of the client's contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "firstName", "description": "

First name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "lastName", "description": "

Last name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "email", "description": "

First name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobile", "description": "

Mobile number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhone", "description": "

Work phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhone", "description": "

Home phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom", "description": "

Object of custom variables.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" @@ -1069,7 +909,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"type\": \"Email\",\n \"value\": \"john.doe@example.com\"\n }\n ]\n }\n ]\n}", + "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n ]\n}", "type": "json" } ] @@ -1079,10 +919,10 @@ define({ "api": [ }, { "type": "Delete", - "url": "/crm/client/:id", + "url": "/crm/client/:clientID", "title": "Delete Client", "name": "DeleteClient", - "order": "5", + "order": "4", "group": "CRM", "version": "1.0.0", "examples": [ @@ -1123,7 +963,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Deleted\"\n }\n ]\n}", + "content": "{\n \"payload\": [\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Deleted\"\n ]\n}", "type": "json" } ] @@ -1144,83 +984,90 @@ define({ "api": [ "Contact Fields": [ { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "firstName", "description": "

First name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "lastName", "description": "

Last name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "email", - "description": "

First name of contact.

" + "description": "

Email address of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobile", "description": "

Mobile number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhone", "description": "

Work phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhone", "description": "

Home phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom", "description": "

Object of custom variables.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" } ] - } + }, + "examples": [ + { + "title": "Request Body Example:", + "content": " {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"mobile\": \"0123 456 789\",\n \"mobileAreaCode\": \"+61\"\n}", + "type": "json" + } + ] }, "examples": [ { @@ -1233,7 +1080,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"type\": \"Email\",\n \"value\": \"john.doe@example.com\"\n }\n ]\n }\n ]\n}", + "content": "{\n \"payload\": {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0123 456 789\",\n \"mobileAreaCode\": \"+61\"\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n}", "type": "json" } ] @@ -1243,7 +1090,7 @@ define({ "api": [ }, { "type": "Get", - "url": "/crm/client/:id", + "url": "/crm/client/:clientID", "title": "Get Client", "name": "GetClient", "order": "2", @@ -1260,7 +1107,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryContactPhone\": \"0000 000 000\",\n \"primaryContactEmail\": \"jane.doe@example.com\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contact\": {\n \"80\": {\n \"id\": \"80\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {}\n },\n \"81\": {\n \"id\": \"81\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {}\n }\n },\n \"location\": {\n \"79\": {\n \"id\": 79,\n \"street1\": \"STREET_1\",\n \"street2\": \"STREET_2\",\n \"city\": \"CITY\",\n \"state\": \"STATE\",\n \"postcode\": \"\",\n \"country\": \"AUSTRALIA\",\n \"zones\": [\n {\n \"id\": \"1\",\n \"value\": \"Zone A\"\n },\n {\n \"id\": \"2\",\n \"value\": \"Zone B\"\n }\n ],\n \"custom\": \"[]\"\n }\n }\n }\n}", + "content": " {\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactID\": \"80\",\n \"primaryAddressID\": \"79\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryContactPhone\": \"0000 000 000\",\n \"primaryContactEmail\": \"jane.doe@example.com\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contact\": [\n {\n \"id\": \"80\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {}\n },\n {\n \"id\": \"81\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {\n \"24\": {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n }\n }\n ],\n \"location\": [\n {\n \"id\": 79,\n \"sitename\": false,\n \"street1\": \"STREET_1\",\n \"street2\": \"STREET_2\",\n \"city\": \"CITY\",\n \"state\": \"STATE\",\n \"postcode\": \"\",\n \"country\": \"AUSTRALIA\",\n \"zones\": [\n {\n \"id\": \"1\",\n \"value\": \"Zone A\"\n },\n {\n \"id\": \"2\",\n \"value\": \"Zone B\"\n }\n ],\n \"custom\": {}\n }\n ]\n }\n}", "type": "json" } ] @@ -1270,12 +1117,52 @@ define({ "api": [ }, { "type": "Get", - "url": "/crm/client/:id/contact/", - "title": "Get Contacts", + "url": "/crm/client/:clientID/contact/:contactID", + "title": "Get Contact", "name": "GetContact", - "order": "6", + "order": "7", + "group": "CRM", + "version": "1.0.0", + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/client/77/contact/78", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": " {\n \"payload\": {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/crm/client/_apidoc.js", + "groupTitle": "CRM" + }, + { + "type": "Get", + "url": "/crm/client/:clientID/contact/", + "title": "List Contacts", + "name": "ListContact", + "order": "5", "group": "CRM", "version": "1.0.0", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + } + ] + } + }, "examples": [ { "title": "CURL Example", @@ -1287,7 +1174,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"type\": \"Email\",\n \"value\": \"john.doe@example.com\"\n }\n ]\n }\n ]\n}", + "content": "{\n \"payload\": [\n {\n \"id\": \"80\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": []\n },\n {\n \"id\": \"81\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n ]\n}", "type": "json" } ] @@ -1297,7 +1184,7 @@ define({ "api": [ }, { "type": "Get", - "url": "/crm/client/list/?page=1", + "url": "/crm/client/list/", "title": "List Clients", "description": "

List all the contacts and clients available, returns 500 at a time.

", "name": "ListContactsClient", @@ -1310,7 +1197,7 @@ define({ "api": [ { "group": "Optional", "type": "number", - "optional": false, + "optional": true, "field": "page", "description": "

The page number, starting from 1.

" } @@ -1328,7 +1215,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"93\",\n \"billingName\": \"Business Name\",\n \"name\": \"Jane Doe\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": {\n \"110\": {\n \"id\": \"110\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n },\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"94\",\n \"billingName\": \"Business Name\",\n \"name\": \"John Doe\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": {\n \"111\": {\n \"id\": \"111\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n },\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"67\",\n \"clientID\": \"67\",\n \"contactID\": \"67\",\n \"billingName\": \"Formitize\",\n \"name\": \"SUPPORT\",\n \"firstName\": \"SUPPORT\",\n \"lastName\": \"\",\n \"status\": \"Active\",\n \"clientType\": \"\",\n \"primaryAddress\": \"Rodeo Rd, Gregory Hills\",\n \"cachedata\": {\n \"84\": {\n \"id\": \"84\",\n \"type\": \"Email\",\n \"extra\": \"\",\n \"value\": \"support@formitize.com\",\n \"datatype\": \"\"\n },\n \"85\": {\n \"id\": \"85\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0400 000 000\",\n \"datatype\": \"\"\n },\n \"86\": {\n \"id\": \"86\",\n \"type\": \"Work Phone\",\n \"extra\": \"\",\n \"value\": \"1300 552 008\",\n \"datatype\": \"\"\n }\n },\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n }\n ]\n}", + "content": "{\n \"payload\": [\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"93\",\n \"billingName\": \"Business Name\",\n \"name\": \"Jane Doe\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": [\n {\n \"id\": \"110\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n ],\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"94\",\n \"billingName\": \"Business Name\",\n \"name\": \"John Doe\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": [\n {\n \"id\": \"111\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n ],\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"67\",\n \"clientID\": \"67\",\n \"contactID\": \"67\",\n \"billingName\": \"Formitize\",\n \"name\": \"SUPPORT\",\n \"firstName\": \"SUPPORT\",\n \"lastName\": \"\",\n \"status\": \"Active\",\n \"clientType\": \"\",\n \"primaryAddress\": \"Rodeo Rd, Gregory Hills\",\n \"cachedata\": [\n {\n \"id\": \"84\",\n \"type\": \"Email\",\n \"extra\": \"\",\n \"value\": \"support@formitize.com\",\n \"datatype\": \"\"\n },\n {\n \"id\": \"85\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0400 000 000\",\n \"datatype\": \"\"\n },\n {\n \"id\": \"86\",\n \"type\": \"Work Phone\",\n \"extra\": \"\",\n \"value\": \"1300 552 008\",\n \"datatype\": \"\"\n }\n ],\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n }\n ]\n}", "type": "json" } ] @@ -1351,161 +1238,161 @@ define({ "api": [ "Client Fields": [ { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.country", "description": "

Country address.

" @@ -1524,7 +1411,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", + "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", "type": "json" } ] @@ -1532,10 +1419,10 @@ define({ "api": [ }, { "type": "post", - "url": "/crm/client/:id", + "url": "/crm/client/:clientID", "title": "Edit Client", "name": "PostEditClient", - "order": "2", + "order": "3", "group": "CRM", "version": "1.0.0", "filename": "app/system/class/api/rest/v1/crm/client/_apidoc.js", @@ -1545,161 +1432,161 @@ define({ "api": [ "Client Fields": [ { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.country", "description": "

Country address.

" @@ -1718,7 +1605,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", + "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", "type": "json" } ] @@ -1743,7 +1630,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": 226,\n \"invoiceNumber\": \"INVF-05932\",\n \"invoiceDate\": \"04th Jun 2020\",\n \"client\": {\n \"id\": 103,\n \"billingName\": \"My Contact\"\n },\n \"orderNumber\": \"\",\n \"referenceNumber\": \"\",\n \"addressTo\": \"\",\n \"currency\": \"AUD\",\n \"status\": \"Open\",\n \"type\": \"ACCREC\",\n \"lineItems\": [\n {\n \"id\": \"274\",\n \"code\": \"\",\n \"description\": \"3333\",\n \"quantity\": \"1\",\n \"unitAmount\": \"44\",\n \"discountPercentage\": \"0\",\n \"lineSubtotal\": 40,\n \"taxAmount\": 4,\n \"lineTotal\": 44\n }\n ],\n \"taxType\": \"INCLUSIVE\",\n \"tax\": 4,\n \"subtotal\": 40,\n \"total\": 44,\n \"amountPaid\": 0,\n \"payments\": [],\n \"history\": [\n {\n \"by\": \"User\",\n \"userName\": \"Sam John\",\n \"note\": \"Added 1 row.\",\n \"date\": \"11th Aug 2022 11:26am\",\n \"dateTimestamp\": \"1660181216\"\n }\n ]\n }\n}", + "content": "{\n \"payload\": {\n \"id\": 226,\n \"invoiceNumber\": \"INVF-05932\",\n \"invoiceDate\": 1591192800,\n \"invoiceDateFormatted\": \"04th Jun 2020\",\n \"expectedPayDate\": 1591192800,\n \"expectedPayDateFormatted\": \"04th Jun 2020\",\n \"clientID\": 103,\n \"companyName\": \"My Contact\",\n \"primaryAddress\": \"1234 Abc Street\",\n \"primaryContactName\": \"Jeff\",\n \"primaryContactPhone\": \"0410 000 000\",\n \"primaryContactEmail\": \"test@email.com\",\n \"client\": {\n \"id\": 103,\n \"billingName\": \"My Contact\"\n },\n \"contact\": {\n \"name\": \"Invoice Contact\",\n \"email\": \"other@test.com\",\n \"mobile\": \"0420 000 000\"\n },\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"addressTo\": \"\",\n \"currency\": \"AUD\",\n \"status\": \"Open\",\n \"type\": \"ACCREC\",\n \"lineItems\": [\n {\n \"id\": \"274\",\n \"code\": \"\",\n \"description\": \"3333\",\n \"quantity\": \"1\",\n \"unitAmount\": \"44\",\n \"discountPercentage\": \"0\",\n \"lineSubtotal\": 40,\n \"taxAmount\": 4,\n \"lineTotal\": 44\n }\n ],\n \"taxType\": \"INCLUSIVE\",\n \"tax\": 4,\n \"subtotal\": 40,\n \"total\": 44,\n \"amountPaid\": 0,\n \"payments\": [],\n \"pdfUrl\": \"https://service.formitize.com/s/xxxx-xxxx-xxxx-xxxx\",\n \"attachedTo\": {\n \"job\": [\n 20000,\n 30000,\n 31353\n ],\n \"quote\": [\n \"QU-001\",\n \"QU-002\"\n ]\n },\n \"history\": [\n {\n \"by\": \"User\",\n \"userName\": \"Sam John\",\n \"note\": \"Added 1 row.\",\n \"date\": \"11th Aug 2022 11:26am\",\n \"dateTimestamp\": \"1660181216\"\n }\n ]\n }\n}", "type": "json" } ] @@ -1751,14 +1638,142 @@ define({ "api": [ "filename": "app/system/class/api/rest/v1/crm/accounts/invoice/_apidoc.js", "groupTitle": "CRM_Accounts" }, + { + "type": "Get", + "url": "/crm/accounts/quote/:id", + "title": "Get Quote", + "name": "GetQuote", + "order": "1", + "group": "CRM_Accounts", + "version": "1.0.0", + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/accounts/quote/77", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": "{\n \"payload\": {\n \"id\": 226,\n \"quoteNumber\": \"INVF-05932\",\n \"quoteDate\": 1591192800,\n \"quoteDateFormatted\": \"04th Jun 2020\",\n \"clientID\": 103,\n \"companyName\": \"My Contact\",\n \"primaryAddress\": \"1234 Abc Street\",\n \"primaryContactName\": \"Jeff\",\n \"primaryContactPhone\": \"0410 000 000\",\n \"primaryContactEmail\": \"test@email.com\",\n \"client\": {\n \"id\": 103,\n \"billingName\": \"My Contact\"\n },\n \"contact\": {\n \"name\": \"Quote Contact\",\n \"email\": \"other@test.com\",\n \"mobile\": \"0420 000 000\"\n },\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"addressTo\": \"\",\n \"currency\": \"AUD\",\n \"status\": \"Open\",\n \"type\": \"ACCREC\",\n \"lineItems\": [\n {\n \"id\": \"274\",\n \"code\": \"\",\n \"description\": \"3333\",\n \"quantity\": \"1\",\n \"unitAmount\": \"44\",\n \"discountPercentage\": \"0\",\n \"lineSubtotal\": 40,\n \"taxAmount\": 4,\n \"lineTotal\": 44\n }\n ],\n \"taxType\": \"INCLUSIVE\",\n \"tax\": 4,\n \"subtotal\": 40,\n \"total\": 44,\n \"amountPaid\": 0,\n \"pdfUrl\": \"https://service.formitize.com/s/xxxx-xxxx-xxxx-xxxx\",\n \"attachedTo\": {\n \"job\": [\n 20000,\n 30000,\n 31353\n ],\n \"quote\": [\n \"QU-001\",\n \"QU-002\"\n ]\n },\n \"history\": [\n {\n \"by\": \"User\",\n \"userName\": \"Sam John\",\n \"note\": \"Added 1 row.\",\n \"date\": \"11th Aug 2022 11:26am\",\n \"dateTimestamp\": \"1660181216\"\n }\n ]\n }\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/crm/accounts/quote/_apidoc.js", + "groupTitle": "CRM_Accounts" + }, { "type": "Get", "url": "/crm/accounts/invoice/list", - "title": "List Invoice", + "title": "List Invoices", "name": "ListInvoice", + "description": "

List invoices available, returns 500 at a time.

", "order": "0", "group": "CRM_Accounts", "version": "1.0.0", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "limit", + "description": "

The number of rows returned. Default is 500.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "clientID", + "description": "

List invoices with the specified Client ID.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"0,1\"" + ], + "optional": true, + "field": "status", + "description": "

List invoices matching the specified status. 0 = Draft, 1 = Open, 3 = Cancelled.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"2\"", + "\"1,2\"" + ], + "optional": true, + "field": "paymentstatus", + "description": "

List invoices matching the specified payment status. 1 = Unpaid, 2 = Paid, 3 = Overdue, 5 = Expired.

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "value", + "description": "

Search for invoices that contain the specified search value. Fields included in search are quoteNumber, orderNumber, addressTo, reference, invoiceNumber, leadId, title, companyName, primaryContactName, primaryContactEmail

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-from", + "description": "

List invoices created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-to", + "description": "

List invoices created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "invoicedate-from", + "description": "

List invoices with invoice date on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "invoicedate-to", + "description": "

List invoices with invoice date on or after the given date.

" + } + ] + } + }, "examples": [ { "title": "CURL Example", @@ -1770,7 +1785,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"485\",\n \"addressTo\": \"5553 New Canterbury Road, Dulwich Hill New South Wales 2203, Australia\",\n \"clientID\": \"103\",\n \"total\": \"0\",\n \"subtotal\": \"0\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-00115\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"0\",\n \"status\": \"Draft\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"1\",\n \"taxType\": \"INCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661090400\",\n \"expectedPayDateFormatted\": \"22nd Aug 2022\",\n \"invoiceDate\": \"1660831200\",\n \"invoiceDateFormatted\": \"19th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Made on Xero\",\n \"primaryAddress\": \"11 Rodeo Rd, Gregory Hills NSW 2557\",\n \"primaryContact\": \"103\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n },\n {\n \"id\": \"483\",\n \"addressTo\": \"\",\n \"clientID\": \"80\",\n \"total\": \"5\",\n \"subtotal\": \"5\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-0343\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"1\",\n \"status\": \"Open\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"2\",\n \"taxType\": \"EXCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661263200\",\n \"expectedPayDateFormatted\": \"24th Aug 2022\",\n \"invoiceDate\": \"1660053600\",\n \"invoiceDateFormatted\": \"10th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Test\",\n \"primaryAddress\": \"George Street, Sydney, NSW 2000\",\n \"primaryContact\": \"80\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n }\n ]\n}", + "content": " {\n \"payload\": [\n {\n \"id\": \"485\",\n \"addressTo\": \"5553 New Canterbury Road, Dulwich Hill New South Wales 2203, Australia\",\n \"clientID\": \"103\",\n \"total\": \"0\",\n \"subtotal\": \"0\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-00115\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"0\",\n \"status\": \"Draft\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"1\",\n \"taxType\": \"INCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661090400\",\n \"expectedPayDateFormatted\": \"22nd Aug 2022\",\n \"invoiceDate\": \"1660831200\",\n \"invoiceDateFormatted\": \"19th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Made on Xero\",\n \"primaryAddress\": \"11 Rodeo Rd, Gregory Hills NSW 2557\",\n \"primaryContact\": \"103\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n },\n {\n \"id\": \"483\",\n \"addressTo\": \"\",\n \"clientID\": \"80\",\n \"total\": \"5\",\n \"subtotal\": \"5\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-0343\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"1\",\n \"status\": \"Open\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"2\",\n \"taxType\": \"EXCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661263200\",\n \"expectedPayDateFormatted\": \"24th Aug 2022\",\n \"invoiceDate\": \"1660053600\",\n \"invoiceDateFormatted\": \"10th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Test\",\n \"primaryAddress\": \"George Street, Sydney, NSW 2000\",\n \"primaryContact\": \"80\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n }\n ]\n}", "type": "json" } ] @@ -1778,12 +1793,129 @@ define({ "api": [ "filename": "app/system/class/api/rest/v1/crm/accounts/invoice/_apidoc.js", "groupTitle": "CRM_Accounts" }, + { + "type": "Get", + "url": "/crm/accounts/quote/list", + "title": "List Quotes", + "name": "ListQuote", + "description": "

List quotes available, returns 500 at a time.

", + "order": "0", + "group": "CRM_Accounts", + "version": "1.0.0", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "limit", + "description": "

The number of rows returned. Default is 500.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "clientID", + "description": "

List quotes with the specified Client ID.

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "value", + "description": "

Search for quotes that contain the specified search value.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"1,2\"" + ], + "optional": true, + "field": "status", + "description": "

List quotes matching the specified status. 1 = Open, 2 = Accepted, 3 = Lost, 4 = Closed.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-from", + "description": "

List quotes created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-to", + "description": "

List quotes created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "quotedate-from", + "description": "

List quotes with quote date on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "quotedate-to", + "description": "

List quotes with quote date on or after the given date.

" + } + ] + } + }, + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/accounts/quote/list", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": " {\n \"payload\": [\n {\n \"id\": \"485\",\n \"addressTo\": \"5553 New Canterbury Road, Dulwich Hill New South Wales 2203, Australia\",\n \"clientID\": \"103\",\n \"total\": \"0\",\n \"subtotal\": \"0\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"quoteNumber\": \"QU-00115\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"0\",\n \"status\": \"Draft\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"1\",\n \"taxType\": \"INCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"quoteDate\": \"1660831200\",\n \"quoteDateFormatted\": \"19th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Made on Xero\",\n \"primaryAddress\": \"11 Rodeo Rd, Gregory Hills NSW 2557\",\n \"primaryContact\": \"103\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n },\n {\n \"id\": \"483\",\n \"addressTo\": \"\",\n \"clientID\": \"80\",\n \"total\": \"5\",\n \"subtotal\": \"5\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"quoteNumber\": \"INV-0343\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"1\",\n \"status\": \"Open\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"2\",\n \"taxType\": \"EXCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"quoteDate\": \"1660053600\",\n \"quoteDateFormatted\": \"10th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Test\",\n \"primaryAddress\": \"George Street, Sydney, NSW 2000\",\n \"primaryContact\": \"80\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n }\n ]\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/crm/accounts/quote/_apidoc.js", + "groupTitle": "CRM_Accounts" + }, { "type": "Delete", "url": "/crm/client/:clientid/location/:locationid", "title": "Delete Location", "name": "DeleteClientLocation", - "order": "5", + "order": "4", "group": "CRM_Location", "version": "1.0.0", "examples": [ @@ -1851,7 +1983,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"80\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }\n}", + "content": " {\n \"payload\": {\n \"id\": \"80\",\n \"siteName\": \"\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }\n}", "type": "json" } ] @@ -1862,15 +1994,15 @@ define({ "api": [ { "type": "Get", "url": "/crm/client/:clientid/location/", - "title": "Get Locations", - "name": "GetClientLocations", - "order": "2", + "title": "List Locations", + "name": "ListClientLocations", + "order": "0", "group": "CRM_Location", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/client/77/locations", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/client/77/location", "type": "json" } ], @@ -1878,7 +2010,7 @@ define({ "api": [ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [{\n \"id\": \"80\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n },\n {\n \"id\": \"84\",\n \"street1\": \"456 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n },\n ...]\n}", + "content": " {\n \"payload\": [\n {\n \"id\": \"80\",\n \"siteName\": \"\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n },\n {\n \"id\": \"84\",\n \"siteName\": \"\",\n \"street1\": \"456 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }\n ]\n}", "type": "json" } ] @@ -1899,42 +2031,49 @@ define({ "api": [ "Location Fields": [ { "group": "Location Fields", - "type": "String", + "type": "string", + "optional": true, + "field": "siteName", + "description": "

Site name.

" + }, + { + "group": "Location Fields", + "type": "string", "optional": true, "field": "street1", "description": "

Street 1 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "street2", "description": "

Street 2 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "city", "description": "

City address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "state", "description": "

State address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "postcode", "description": "

Postcode address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "country", "description": "

Country address.

" @@ -1959,7 +2098,7 @@ define({ "api": [ "url": "/crm/client/:clientid/location/:locationid", "title": "Edit Location", "name": "PostEditClientLocation", - "order": "2", + "order": "3", "group": "CRM_Location", "version": "1.0.0", "parameter": { @@ -1967,42 +2106,49 @@ define({ "api": [ "Location Fields": [ { "group": "Location Fields", - "type": "String", + "type": "string", + "optional": true, + "field": "siteName", + "description": "

Site name.

" + }, + { + "group": "Location Fields", + "type": "string", "optional": true, "field": "street1", "description": "

Street 1 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "street2", "description": "

Street 2 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "city", "description": "

City address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "state", "description": "

State address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "postcode", "description": "

Postcode address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "country", "description": "

Country address.

" @@ -2022,6 +2168,34 @@ define({ "api": [ "filename": "app/system/class/api/rest/v1/crm/client/_apidoc.location.js", "groupTitle": "CRM_Location" }, + { + "type": "delete", + "url": "/database/:tablename/all", + "title": "Delete Data From A Table", + "name": "DatabaseDelete", + "order": "3", + "description": "

Delete all records from a specified table.

", + "group": "Database", + "version": "1.0.0", + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"DELETE\" https://service.formitize.com/api/rest/v2/database/example_table/all", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": "{\n\"payload\": {\n\"result\": \"success\",\n\"note\": \"Database records deleted.\"\n}\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/database/_apidoc.js", + "groupTitle": "Database" + }, { "type": "get", "url": "/database/list", @@ -2047,7 +2221,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t...,\n\t\t\"128876\": {\n\t\t\t\"id\": \"128876\",\n\t\t\t\"name\": \"database_test\",\n\t\t\t\"title\": \"\",\n\t\t\t\"dateModified\": \"1590392617\",\n\t\t\t\"storeOnPhone\": \"1\",\n\t\t\t\"columns\": [\n\t\t\t\t\"id\",\n\t\t\t\t\"ColumnA\",\n\t\t\t\t\"ColumnB\",\n\t\t\t\t\"ColumnC\"\n\t\t\t],\n\t\t\t\"url\": \"https://service.formitize.com/api/rest/v2/database/example_table\"\t\t\t\n\t\t},\n\t\t...\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t...,\n\t\t\"128876\": {\n\t\t\t\"id\": \"128876\",\n\t\t\t\"name\": \"database_test\",\n\t\t\t\"title\": \"\",\n\t\t\t\"dateModified\": \"1590392617\",\n\t\t\t\"dateTruncated\": \"0\",\n \"deleted\": \"0\",\n \"type\": \"2\",\n\t\t\t\"storeOnPhone\": \"1\",\n\t\t\t\"config\": \"[]\",\n\t\t\t\"columns\": [\n\t\t\t\t\"id\",\n\t\t\t\t\"ColumnA\",\n\t\t\t\t\"ColumnB\",\n\t\t\t\t\"ColumnC\"\n\t\t\t],\n\t\t\t\"url\": \"https://service.formitize.com/api/rest/v2/database/example_table\"\n\t\t},\n\t\t...\n\t}\n}", "type": "JSON" } ] @@ -2077,9 +2251,9 @@ define({ "api": [ { "group": "Body", "type": "json", - "optional": false, + "optional": true, "field": "pk", - "description": "

Optional, list of primary keys used to match content when insert/updating values.

" + "description": "

List of primary keys used to match content when insert/updating values.

" } ] } @@ -2121,15 +2295,15 @@ define({ "api": [ "Optional": [ { "group": "Optional", - "type": "Boolean", - "optional": false, + "type": "boolean", + "optional": true, "field": "simple", "description": "

If true, only returns a list of objects with no form-schema data.

" }, { "group": "Optional", - "type": "Number", - "optional": false, + "type": "number", + "optional": true, "field": "id", "description": "

If a form ID is known, then return information about that form.

" } @@ -2147,12 +2321,12 @@ define({ "api": [ "examples": [ { "title": "CURL Response (simple)", - "content": "{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\"\n\t\t},\n\t\t\"35624\": {\n\t\t\t\"formID\": \"35624\",\n\t\t\t\"title\": \"Sample Form\"\n\t\t},\n\t\t\"35634\": {\n\t\t\t\"formID\": \"35634\",\n\t\t\t\"title\": \"Client Questionaire\"\n\t\t}\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114\n\t\t},\n\t\t\"35624\": {\n\t\t\t\"formID\": \"35624\",\n\t\t\t\"title\": \"Sample Form\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114\n\t\t},\n\t\t\"35634\": {\n\t\t\t\"formID\": \"35634\",\n\t\t\t\"title\": \"Client Questionaire\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114\n\t\t}\n\t}\n}", "type": "JSON" }, { "title": "CURL Response (with form schema)", - "content": "\n{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"elements\": {\n\t\t\t\t\"formSubheader_1\": {\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"register_1\": {\n\t\t\t\t\t\t\t\"name\": \"register_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formRow_1\": {\n\t\t\t\t\t\t\t\"name\": \"formRow_1\",\n\t\t\t\t\t\t\t\"type\": \"formRow\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formAsset_2\": {\n\t\t\t\t\t\t\t\"name\": \"formAsset_2\",\n\t\t\t\t\t\t\t\"type\": \"formAsset\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formGPS_1\": {\n\t\t\t\t\t\t\t\"name\": \"formGPS_1\",\n\t\t\t\t\t\t\t\"type\": \"formGPS\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRM_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRM_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRM\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_5\": {\n\t\t\t\t\t\t\t\"name\": \"formText_5\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_6\": {\n\t\t\t\t\t\t\t\"name\": \"formText_6\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formPageSplit_1\": {\n\t\t\t\t\t\t\t\"name\": \"formPageSplit_1\",\n\t\t\t\t\t\t\t\"type\": \"formPageSplit\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRMLocation_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRMLocation_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRMLocation\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_7\": {\n\t\t\t\t\t\t\t\"name\": \"formText_7\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", + "content": "\n{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114,\n\t\t\t\"elements\": {\n\t\t\t\t\"formSubheader_1\": {\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"register_1\": {\n\t\t\t\t\t\t\t\"name\": \"register_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 3\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formRow_1\": {\n\t\t\t\t\t\t\t\"name\": \"formRow_1\",\n\t\t\t\t\t\t\t\"type\": \"formRow\",\n\t\t\t\t\t\t\t\"id\": 4\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formAsset_2\": {\n\t\t\t\t\t\t\t\"name\": \"formAsset_2\",\n\t\t\t\t\t\t\t\"type\": \"formAsset\",\n\t\t\t\t\t\t\t\"id\": 5\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formGPS_1\": {\n\t\t\t\t\t\t\t\"name\": \"formGPS_1\",\n\t\t\t\t\t\t\t\"type\": \"formGPS\",\n\t\t\t\t\t\t\t\"id\": 6\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRM_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRM_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRM\",\n\t\t\t\t\t\t\t\"id\": 7\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_5\": {\n\t\t\t\t\t\t\t\"name\": \"formText_5\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 8\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_6\": {\n\t\t\t\t\t\t\t\"name\": \"formText_6\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 9\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formPageSplit_1\": {\n\t\t\t\t\t\t\t\"name\": \"formPageSplit_1\",\n\t\t\t\t\t\t\t\"type\": \"formPageSplit\",\n\t\t\t\t\t\t\t\"id\": 10\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 11\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRMLocation_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRMLocation_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRMLocation\",\n\t\t\t\t\t\t\t\"id\": 12\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_7\": {\n\t\t\t\t\t\t\t\"name\": \"formMultiple_1\",\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"id\": 13,\n\t\t\t\t\t\t\t\"options\": {\n \"0\": \"-\",\n \"1\": \"Option A\",\n \"2\": \"Option B\",\n \"3\": \"Option C\"\n }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t...\n\t\t\t}\n\t\t}\n\t}\n}", "type": "JSON" } ] @@ -2170,13 +2344,13 @@ define({ "api": [ "order": "2", "parameter": { "fields": { - "Arguements": [ + "Optional": [ { - "group": "Arguements", - "type": "Number", - "optional": false, - "field": "id", - "description": "

Return information about that form template.

" + "group": "Optional", + "type": "boolean", + "optional": true, + "field": "simple", + "description": "

If true, returns simplified details with no form-schema data.

" } ] } @@ -2192,7 +2366,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t\"formID\": \"35634\",\n\t\t\"title\": \"UPPERCASE_TEST\",\n\t\t\"elements\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\"children\": {\n\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_2\": {\n\t\t\t\t\t\t\"name\": \"formText_2\",\n\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_3\": {\n\t\t\t\t\t\t\"name\": \"formText_3\",\n\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"formID\": \"35634\",\n\t\t\"title\": \"UPPERCASE_TEST\",\n\t\t\"dateModified\": 1642224380,\n \"dateCreated\": 1441184114,\n\t\t\"elements\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\"id\": 2,\n\t\t\t\t\"children\": {\n\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\"id\": 3\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_2\": {\n\t\t\t\t\t\t\"name\": \"formText_2\",\n\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\"id\": 4\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_3\": {\n\t\t\t\t\t\t\"name\": \"formText_3\",\n\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\"id\": 5\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "type": "JSON" } ] @@ -2221,6 +2395,15 @@ define({ "api": [ "type": "CSharp" } ], + "success": { + "examples": [ + { + "title": "Success-Response:", + "content": " HTTP/1.1 200 OK\n{\n \"payload\": {\n \"id\": \"1\",\n \"message\": \"Successfully deleted job.\"\n }\n}", + "type": "json" + } + ] + }, "filename": "app/system/class/api/rest/v1/job/_apidoc.js", "groupTitle": "Job" }, @@ -2229,7 +2412,7 @@ define({ "api": [ "url": "/job/:id", "title": "Get Job", "name": "GetJob", - "order": "5", + "order": "2", "group": "Job", "version": "1.0.0", "description": "

Get a job.

", @@ -2244,7 +2427,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"id\": \"245\",\n \"maintenanceID\": \"0\",\n \"jobNumber\": \"245\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Test B\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"\",\n \"description\": \"\",\n \"dueDate\": \"1599688800\",\n \"assignedTo\": \"0\",\n \"priority\": \"0\",\n \"status\": \"1\",\n \"duration\": \"136800\",\n \"statusLabel\": \"Created\"\n }\n}", + "content": "{\n \"payload\": {\n \"id\": \"245\",\n \"maintenanceID\": \"0\",\n \"clientID\": \"8\",\n \"contactID\": \"12\",\n \"billingName\": \"Test client\",\n \"contactName\": \"John Doe\",\n \"jobNumber\": \"245\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Test B\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"\",\n \"description\": \"\",\n \"dueDate\": \"1599688800\",\n \"assignedTo\": \"0\",\n \"priority\": \"0\",\n \"status\": \"1\",\n \"duration\": \"136800\",\n \"statusLabel\": \"Created\",\n \"history\": {},\n \"notes\": {}\n }\n}", "type": "JSON" } ] @@ -2270,7 +2453,7 @@ define({ "api": [ "examples": [ { "title": "Success-Response:", - "content": "HTTP/1.1 200 OK\n{\n \"payload\": [{\n \"text\": \"Created Job.\",\n \"startDate\": \"2021-04-28T15:57:46+10:00\",\n \"endDate\": \"2021-04-28T15:57:46+10:00\",\n }]\n}", + "content": "HTTP/1.1 200 OK\n{\n \"payload\": [\n {\n \"type\": \"1\",\n \"text\": \"Edited Job.\",\n \"startDate\": \"2022-01-18T10:07:09+11:00\",\n \"endDate\": \"2022-01-18T10:07:09+11:00\",\n \"fields\": {\n \"dueDate\": 1642456800,\n \"duration\": 5400,\n \"endDate\": 1642462200\n },\n \"lat\": \"\",\n \"lng\": \"\"\n },\n {\n \"type\": \"1\",\n \"text\": \"Edited Job.\",\n \"startDate\": \"2022-01-17T22:31:15+11:00\",\n \"endDate\": \"2022-01-17T22:31:15+11:00\",\n \"fields\": [],\n \"lat\": \"\",\n \"lng\": \"\"\n },\n ...\n ]\n}", "type": "json" } ] @@ -2284,10 +2467,110 @@ define({ "api": [ "url": "/job/", "title": "List Jobs", "name": "ListJob", - "order": "1", + "order": "0", "group": "Job", "version": "1.0.0", - "description": "

Get a list of jobs.

", + "description": "

Get a list of jobs, lists 500 at a time. Only lists unfinished jobs by default.

", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "boolean", + "optional": true, + "field": "finished", + "description": "

List finished jobs if set (lists unfinished jobs by default).

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "from", + "description": "

List jobs with a Due Date starting from the specified date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "to", + "description": "

List jobs with a Due Date ending before the specified date.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "limit", + "description": "

The number of rows returned. Default is 500.

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "value", + "description": "

Search for invoices that contain the specified search value. Fields included in search are billingName, contactName, deliveryContact, deliveryLocation, description, invoiceNumber, jobNumber, location, orderNumber, pickupSiteName, siteName, title

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"ASC\"", + "\"DESC\"" + ], + "optional": true, + "field": "order", + "defaultValue": "DESC", + "description": "

Sort the results by Job ID (defaults to most recent first).

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "ordernumber", + "description": "

List jobs for the specified Order Number.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "jobnumber", + "description": "

List jobs for the specified Job Number.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"2\"", + "\"1,2,3\"" + ], + "optional": true, + "field": "status", + "description": "

List jobs matching the specified status. Valid status values (comma-delimited):

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "agentName", + "description": "

List jobs assigned to the specified username.

" + } + ] + } + }, "examples": [ { "title": "CURL Example", @@ -2299,7 +2582,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"5555\": {\n \"id\": \"5555\",\n \"maintenanceID\": \"0\",\n \"jobNumber\": \"\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Person A\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"123 Street\",\n \"description\": \"\",\n \"dueDate\": \"1417139760\",\n \"assignedTo\": \"2251\",\n \"priority\": \"0\",\n \"status\": \"4\",\n \"duration\": \"3600\",\n \"statusLabel\": \"Completed\"\n }\n }\n}", + "content": "{\n \"payload\": {\n \"5555\": {\n \"id\": \"5555\",\n \"maintenanceID\": \"0\",\n \"clientID\": \"7\",\n \"contactID\": \"7\",\n \"billingName\": \"Fred Flint\",\n \"contactName\": \"Fred Flint\",\n \"jobNumber\": \"\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Person A\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"123 Street\",\n \"description\": \"\",\n \"dueDate\": \"1417139760\",\n \"assignedTo\": \"2251\",\n \"priority\": \"0\",\n \"status\": \"4\",\n \"duration\": \"3600\",\n \"statusLabel\": \"Completed\"\n }\n }\n}", "type": "JSON" } ] @@ -2320,35 +2603,35 @@ define({ "api": [ "Body": [ { "group": "Body", - "type": "String", + "type": "string", "optional": false, "field": "title", "description": "

The Job Title.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "jobNumber", "description": "

The Job Number.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "orderNumber", "description": "

The Order Number of the job

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "dueDate", "description": "

The date represented in unix timestamp (no-milliseconds)

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "duration", "defaultValue": "60", @@ -2356,28 +2639,28 @@ define({ "api": [ }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "notes", "description": "

Any notes attached to this job, to be viewed by the Technician.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "location", "description": "

Location this job is at.

" }, { "group": "Body", - "type": "String", - "optional": false, + "type": "string", + "optional": true, "field": "agent", - "description": "

The user agent this job will be assigned to. Can either be the User ID or UserNane.

" + "description": "

The user agent this job will be assigned to. Can either be the User ID or Username.

" }, { "group": "Body", - "type": "Boolean", + "type": "boolean", "optional": true, "field": "sendNotification", "defaultValue": "true", @@ -2385,13 +2668,13 @@ define({ "api": [ }, { "group": "Body", - "type": "String", + "type": "string", "allowedValues": [ - "Low", - "Normal", - "Medium", - "High", - "Urgent" + "\"Low\"", + "\"Normal\"", + "\"Medium\"", + "\"High\"", + "\"Urgent\"" ], "optional": true, "field": "priority", @@ -2399,14 +2682,14 @@ define({ "api": [ }, { "group": "Body", - "type": "Number[]", + "type": "number[]", "optional": true, "field": "form", "description": "

The form IDs attached to this job.

" }, { "group": "Body", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "formData", "description": "

The content of the form.

" @@ -2415,42 +2698,42 @@ define({ "api": [ "Delivery Fields": [ { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryLocation", "description": "

If this is a delivery job, where is the drop-off location.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "siteName", "description": "

The delivery location site name.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryContact", "description": "

The contact person to be delivered to.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryPhone", "description": "

The contact's phone number.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryNotes", "description": "

Any notes specific to the delivery.

" }, { "group": "Delivery Fields", - "type": "Number", + "type": "number", "optional": true, "field": "deliveryDate", "description": "

Unixtimestamp(no-ms) of the delivery date/time.

" @@ -2459,168 +2742,168 @@ define({ "api": [ "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -2630,7 +2913,7 @@ define({ "api": [ "examples": [ { "title": "Request Body Example:", - "content": "{\n\t\"id\": 0,\n\t\"title\": \"Job Title\",\n\t\"agent\": \"YourUser\",\n\t\"location\": \"123 Fake St, Suburb, Country\",\n\t\"client\": {\n\t\t\"id\": 0,\n\t\t\"billingName\": \"Test client\",\n\t\t\"contact\": [{\n\t\t\t\"firstName\": \"John\",\n\t\t\t\"lastName\": \"Doe\",\n\t\t\t\"email\": \"john@site.com\",\n\t\t\t\"mobile\": \"0000 000 000\",\n\t\t\t\"mobileAreaCode\": \"+61\",\n\t\t\t\"custom\": {\n\t\t\t\t\"Instagram\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t\t\"Facebook\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t}\n\t\t}, \n\t\t{ ... }],\n\t\t\"location\": [{\n\t\t\t\"street1\": \"123 Fake St\",\n\t\t\t\"street2\": \"\",\n\t\t\t\"city\": \"Some city\",\n\t\t\t\"state\": \"Some state\",\n\t\t\t\"postcode\": \"Some postcode\",\n\t\t\t\"country\": \"Some country\"\n\t\t}, \n\t\t{ ... }]\n\t},\n\t\"formData\": {\n\t\t444: {\n\t\t\t\"formText\": \"Test\"\n\t\t\t\"formMultiple\": [ \"Answer1\", \"Answer2\", \"Answer3\" ],\n\t\t\t\"aRepeatedText\": [\"Value1\", \"Value2\", \"Value3\"],\n\t\t\t\"formTextInARepeatableTableRow\": { \"0_1\": \"Test1\", \"0_2\": \"Test2\" ,\"1_1\": \"Test3\", \"1_2\": \"Test4\" }\n\t\t}\n\t}\n}", + "content": " {\n \"title\": \"Job Title\",\n \"agent\": \"YourUser\",\n \"location\": \"123 Fake St, Suburb, Country\",\n \"client\": {\n \"id\": 0,\n \"billingName\": \"Test client\",\n \"contact\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john@site.com\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"custom\": {\n \"Instagram\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n },\n \"Facebook\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n }\n }\n },\n ...\n ],\n \"location\": [\n {\n \"street1\": \"123 Fake St\",\n \"street2\": \"\",\n \"city\": \"Some city\",\n \"state\": \"Some state\",\n \"postcode\": \"Some postcode\",\n \"country\": \"Some country\"\n },\n ...\n ]\n },\n \"formData\": {\n \"444\": {\n \"formText\": \"Test\",\n \"formMultiple\": [\n \"Answer1\",\n \"Answer2\",\n \"Answer3\"\n ],\n \"aRepeatedText\": [\n \"Value1\",\n \"Value2\",\n \"Value3\"\n ],\n \"formTextInARepeatableTableRow\": {\n \"0_1\": \"Test1\",\n \"0_2\": \"Test2\",\n \"1_1\": \"Test3\",\n \"1_2\": \"Test4\"\n }\n }\n }\n}", "type": "json" }, { @@ -2645,21 +2928,21 @@ define({ "api": [ "Success 200": [ { "group": "Success 200", - "type": "Object", + "type": "object", "optional": false, "field": "payload", "description": "

Payload object.

" }, { "group": "Success 200", - "type": "Number", + "type": "number", "optional": false, "field": "payload.jobID", "description": "

ID of the new created/updaetd job.

" }, { "group": "Success 200", - "type": "Number", + "type": "number", "optional": false, "field": "payload.agentID", "description": "

ID of the agent assigned to the job.

" @@ -2669,7 +2952,7 @@ define({ "api": [ "examples": [ { "title": "Success-Response:", - "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 7,\n \"agentID\": 1,\n }\n}", + "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 7,\n \"agentID\": 1\n }\n}", "type": "json" } ] @@ -2682,7 +2965,7 @@ define({ "api": [ "url": "/job/", "title": "Add Job", "name": "PostJob", - "order": "3", + "order": "1", "version": "1.0.0", "group": "Job", "parameter": { @@ -2690,35 +2973,35 @@ define({ "api": [ "Body": [ { "group": "Body", - "type": "String", + "type": "string", "optional": false, "field": "title", "description": "

The Job Title.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "jobNumber", "description": "

The Job Number.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "orderNumber", "description": "

The Order Number of the job

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "dueDate", "description": "

The date represented in unix timestamp (no-milliseconds)

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "duration", "defaultValue": "60", @@ -2726,28 +3009,28 @@ define({ "api": [ }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "notes", "description": "

Any notes attached to this job, to be viewed by the Technician.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "location", "description": "

Location this job is at.

" }, { "group": "Body", - "type": "String", - "optional": false, + "type": "string", + "optional": true, "field": "agent", - "description": "

The user agent this job will be assigned to. Can either be the User ID or UserNane.

" + "description": "

The user agent this job will be assigned to. Can either be the User ID or Username.

" }, { "group": "Body", - "type": "Boolean", + "type": "boolean", "optional": true, "field": "sendNotification", "defaultValue": "true", @@ -2755,13 +3038,13 @@ define({ "api": [ }, { "group": "Body", - "type": "String", + "type": "string", "allowedValues": [ - "Low", - "Normal", - "Medium", - "High", - "Urgent" + "\"Low\"", + "\"Normal\"", + "\"Medium\"", + "\"High\"", + "\"Urgent\"" ], "optional": true, "field": "priority", @@ -2769,14 +3052,14 @@ define({ "api": [ }, { "group": "Body", - "type": "Number[]", + "type": "number[]", "optional": true, "field": "form", "description": "

The form IDs attached to this job.

" }, { "group": "Body", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "formData", "description": "

The content of the form.

" @@ -2785,212 +3068,212 @@ define({ "api": [ "Delivery Fields": [ { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryLocation", "description": "

If this is a delivery job, where is the drop-off location.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "siteName", "description": "

The delivery location site name.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryContact", "description": "

The contact person to be delivered to.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryPhone", "description": "

The contact's phone number.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryNotes", "description": "

Any notes specific to the delivery.

" }, { "group": "Delivery Fields", - "type": "Number", + "type": "number", "optional": true, "field": "deliveryDate", - "description": "

Unixtimestamp(no-ms) of the delivery date/time.

" + "description": "

Unix timestamp (no-ms) of the delivery date/time.

" } ], "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -3000,7 +3283,7 @@ define({ "api": [ "examples": [ { "title": "Request Body Example:", - "content": "{\n\t\"id\": 0,\n\t\"title\": \"Job Title\",\n\t\"agent\": \"YourUser\",\n\t\"location\": \"123 Fake St, Suburb, Country\",\n\t\"client\": {\n\t\t\"id\": 0,\n\t\t\"billingName\": \"Test client\",\n\t\t\"contact\": [{\n\t\t\t\"firstName\": \"John\",\n\t\t\t\"lastName\": \"Doe\",\n\t\t\t\"email\": \"john@site.com\",\n\t\t\t\"mobile\": \"0000 000 000\",\n\t\t\t\"mobileAreaCode\": \"+61\",\n\t\t\t\"custom\": {\n\t\t\t\t\"Instagram\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t\t\"Facebook\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t}\n\t\t}, \n\t\t{ ... }],\n\t\t\"location\": [{\n\t\t\t\"street1\": \"123 Fake St\",\n\t\t\t\"street2\": \"\",\n\t\t\t\"city\": \"Some city\",\n\t\t\t\"state\": \"Some state\",\n\t\t\t\"postcode\": \"Some postcode\",\n\t\t\t\"country\": \"Some country\"\n\t\t}, \n\t\t{ ... }]\n\t},\n\t\"formData\": {\n\t\t444: {\n\t\t\t\"formText\": \"Test\"\n\t\t\t\"formMultiple\": [ \"Answer1\", \"Answer2\", \"Answer3\" ],\n\t\t\t\"aRepeatedText\": [\"Value1\", \"Value2\", \"Value3\"],\n\t\t\t\"formTextInARepeatableTableRow\": { \"0_1\": \"Test1\", \"0_2\": \"Test2\" ,\"1_1\": \"Test3\", \"1_2\": \"Test4\" }\n\t\t}\n\t}\n}", + "content": "{\n \"id\": 0,\n \"title\": \"Job Title\",\n \"agent\": \"YourUser\",\n \"location\": \"123 Fake St, Suburb, Country\",\n \"client\": {\n \"id\": 0,\n \"billingName\": \"Test client\",\n \"contact\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john@site.com\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"custom\": {\n \"Instagram\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n },\n \"Facebook\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n }\n }\n },\n ...\n ],\n \"location\": [\n {\n \"street1\": \"123 Fake St\",\n \"street2\": \"\",\n \"city\": \"Some city\",\n \"state\": \"Some state\",\n \"postcode\": \"Some postcode\",\n \"country\": \"Some country\"\n },\n ...\n ]\n },\n \"formData\": {\n \"444\": {\n \"formText\": \"Test\",\n \"formMultiple\": [\n \"Answer1\",\n \"Answer2\",\n \"Answer3\"\n ],\n \"aRepeatedText\": [\n \"Value1\",\n \"Value2\",\n \"Value3\"\n ],\n \"formTextInARepeatableTableRow\": {\n \"0_1\": \"Test1\",\n \"0_2\": \"Test2\",\n \"1_1\": \"Test3\",\n \"1_2\": \"Test4\"\n }\n }\n }\n}", "type": "json" }, { @@ -3011,35 +3294,10 @@ define({ "api": [ ] }, "success": { - "fields": { - "Success 200": [ - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "payload", - "description": "

Payload object.

" - }, - { - "group": "Success 200", - "type": "Number", - "optional": false, - "field": "payload.jobID", - "description": "

ID of the new created/updaetd job.

" - }, - { - "group": "Success 200", - "type": "Number", - "optional": false, - "field": "payload.agentID", - "description": "

ID of the agent assigned to the job.

" - } - ] - }, "examples": [ { "title": "Success-Response:", - "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 7,\n \"agentID\": 1,\n }\n}", + "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 1,\n \"jobNumber\": 1,\n \"agentID\": false,\n \"clientID\": 8,\n \"contactID\": 12\n }\n}", "type": "json" } ] @@ -3056,24 +3314,81 @@ define({ "api": [ "order": "2", "version": "1.0.0", "description": "

Returns the submitted form.

", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "boolean", + "optional": true, + "field": "simple", + "description": "

Submitted form data format is simplified if true.

" + } + ] + } + }, + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/form/submit/88", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "CURL Response", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"count\": \"4\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"formDataLastSaved\": \"0\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"status\": \"Ok\",\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" + }, + { + "title": "CURL Response using Simple mode", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"formDataLastSaved\": \"0\",\n \"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": \"0.0\",\n \"longitude\": \"0.0\",\n \"location\": \"\",\n \"status\": \"Ok\",\n \"userID\": \"20150\",\n \"userName\": \"admin\",\n\t\t\"content\": {\n\t\t\t\"signed\": {\n\t\t\t\t\"0\": \"https://UrlToImage/\"\n\t\t\t},\n\t\t\t\"signedDate\": {\n\t\t\t\t\"0\": \"\"\n\t\t\t},\n\t\t\t\"totalPayable\": {\n\t\t\t\t\"0\": \"1231\"\n\t\t\t},\n\t\t\t\"Description of work\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Custom\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"formCheckbox_4\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"No Risks Identified\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"PaymentMethod\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"sendEmail\": {\n\t\t\t\t\"0\": \"dimitri@formitize.com\"\n\t\t\t},\n\t\t\t\"Treatment time\": {\n\t\t\t\t\"0\": \"1:00 AM\"\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" + } + ] + }, + "filename": "app/system/class/api/rest/v1/form/_apidoc.submit.js", + "groupTitle": "Submitted_Forms" + }, + { + "type": "get", + "url": "/form/submit/?id=n", + "title": "Get Submitted Forms by ID", + "name": "SubmittedGetIDs", + "group": "Submitted_Forms", + "order": "3", + "version": "1.0.0", + "description": "

Returns a list of submitted forms or a single form.

", "parameter": { "fields": { "Arguments": [ { "group": "Arguments", - "type": "Number", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"1,2,3\"" + ], "optional": false, "field": "id", - "description": "

The ID of the submitted form.

" + "description": "

The ID(s) of the submitted form(s) (multiples are comma delimited).

" } ], "Optional": [ { "group": "Optional", - "type": "Boolean", - "optional": false, + "type": "boolean", + "optional": true, "field": "simple", "description": "

Submitted form data format is simplified if true.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "jobID", + "description": "

Returns the list of submitted forms attached to a Job ID.

" } ] } @@ -3081,7 +3396,7 @@ define({ "api": [ "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/form/submit/88", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/form/submit/?id=1,2,3", "type": "json" } ], @@ -3089,13 +3404,18 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"count\": \"4\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"146\": {\n\t\t\t\"submittedFormID\": \"146\",\n\t\t\t\"jobID\": \"894\",\n\t\t\t\"formID\": \"35639\",\n\t\t\t\"userID\": \"20150\",\n\t\t\t\"userName\": \"admin\",\n\t\t\t\"count\": \"4\",\n\t\t\t\"version\": \"8\",\n\t\t\t\"title\": \"CRM Extra\",\n\t\t\t\"formDateCreated\": \"1563175490\",\n\t\t\t\"dateSubmitted\": \"1563175490\",\n\t\t\t\"dateModified\": \"1563175490\",\n\t\t\t\"formDataLastSaved\": \"0\",\n\t\t\t\"modifiedBy\": \"0\",\n\t\t\t\"latitude\": false,\n\t\t\t\"longitude\": false,\n\t\t\t\"location\": false,\n\t\t\t\"content\": {\n\t\t\t\t\"formSubheader_1\": {\n\t\t\t\t\t\"0\": {\n\t\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"status\": \"Ok\",\n\t\t\t\"attachments\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\t\"name\": \"Default\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t...\n\t}\n}", "type": "JSON" }, { - "title": "CURL Respose using Simple mode", - "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"signed\": {\n\t\t\t\t\"0\": \"https://UrlToImage/\"\n\t\t\t},\n\t\t\t\"signedDate\": {\n\t\t\t\t\"0\": \"\"\n\t\t\t},\n\t\t\t\"totalPayable\": {\n\t\t\t\t\"0\": \"1231\"\n\t\t\t},\n\t\t\t\"Description of work\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Custom\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"formCheckbox_4\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"No Risks Identified\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"PaymentMethod\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"sendEmail\": {\n\t\t\t\t\"0\": \"dimitri@formitize.com\"\n\t\t\t},\n\t\t\t\"Treatment time\": {\n\t\t\t\t\"0\": \"1:00 AM\"\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", - "type": "CURL" + "title": "CURL Response (single)", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"count\": \"4\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"formDataLastSaved\": \"0\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"status\": \"Ok\",\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" + }, + { + "title": "CURL Response (simple)", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"formDataLastSaved\": \"0\",\n \"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": \"0.0\",\n \"longitude\": \"0.0\",\n \"location\": \"\",\n \"status\": \"Ok\",\n \"userID\": \"20150\",\n \"userName\": \"admin\",\n\t\t\"content\": {\n\t\t\t\"signed\": {\n\t\t\t\t\"0\": \"https://UrlToImage/\"\n\t\t\t},\n\t\t\t\"signedDate\": {\n\t\t\t\t\"0\": \"\"\n\t\t\t},\n\t\t\t\"totalPayable\": {\n\t\t\t\t\"0\": \"1231\"\n\t\t\t},\n\t\t\t\"Description of work\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Custom\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"formCheckbox_4\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"No Risks Identified\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"PaymentMethod\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"sendEmail\": {\n\t\t\t\t\"0\": \"dimitri@formitize.com\"\n\t\t\t},\n\t\t\t\"Treatment time\": {\n\t\t\t\t\"0\": \"1:00 AM\"\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" } ] }, @@ -3116,24 +3436,46 @@ define({ "api": [ "Optional": [ { "group": "Optional", - "type": "String", - "optional": false, + "type": "string", + "optional": true, "field": "title", "description": "

Searches submitted forms for the title.

" }, { "group": "Optional", - "type": "Number", - "optional": false, + "type": "number", + "optional": true, "field": "page", "description": "

Returns the results for x page. Defaults to 1.

" }, { "group": "Optional", - "type": "Number", - "optional": false, + "type": "number", + "optional": true, "field": "jobID", "description": "

Returns the list of submitted forms attached to a Job ID.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "modifiedAfterDate", + "description": "

List submitted forms modified on or after the specified date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"1,2,3\"" + ], + "optional": true, + "field": "formID", + "description": "

List submitted forms from the matching Form ID(s) (multiples are comma-delimited).

" } ] } @@ -3149,7 +3491,7 @@ define({ "api": [ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t\"3\": {\n\t\t\t\"submittedFormID\": 3,\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 1,\n\t\t\t\"dateCreated\": 1543276384,\n\t\t\t\"dateModified\": 1554265832\n\t\t},\n\t\t\"4\": {\n\t\t\t\"submittedFormID\": 4,\n\t\t\t\"title\": \"New Job - Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 3,\n\t\t\t\"dateCreated\": 1543537388,\n\t\t\t\"dateModified\": 1546819983\n\t\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"3\": {\n\t\t\t\"submittedFormID\": 3,\n\t\t\t\"status\": \"Ok\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 1,\n\t\t\t\"dateCreated\": 1543276384,\n\t\t\t\"dateModified\": 1554265832,\n\t\t\t\"latitude\": \"\",\n \"formDataLastSaved\": 0,\n \"dateSubmitted\": 1543276384,\n \"longitude\": \"\",\n \"version\": 2,\n \"count\": \"2\",\n \"location\": \"\",\n \"userName\": \"\"\n\t\t},\n\t\t\"4\": {\n\t\t\t\"submittedFormID\": 4,\n\t\t\t\"status\": \"Ok\",\n\t\t\t\"title\": \"New Job - Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 3,\n\t\t\t\"dateCreated\": 1543537388,\n\t\t\t\"dateModified\": 1546819983,\n\t\t\t\"latitude\": \"\",\n \"formDataLastSaved\": 0,\n \"dateSubmitted\": 1543537388,\n \"longitude\": \"\",\n \"version\": 2,\n \"count\": \"2\",\n \"location\": \"\",\n \"userName\": \"\"\n\t\t}\n}", "type": "JSON" } ] diff --git a/docs/api_data.json b/docs/api_data.json index 5d263ab..3d4ab28 100644 --- a/docs/api_data.json +++ b/docs/api_data.json @@ -1,10 +1,31 @@ [ + { + "type": "delete", + "url": "/asset/:schemaID/:assetID", + "title": "Delete Asset", + "name": "AssetDelete", + "order": "5", + "description": "

Delete an existing asset.

", + "group": "Asset_Management", + "version": "1.0.0", + "success": { + "examples": [ + { + "title": "CURL Response", + "content": "{\n \"payload\": {\n \"result\": \"deleted\"\n }\n}", + "type": "JSON" + } + ] + }, + "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", + "groupTitle": "Asset_Management" + }, { "type": "post", "url": "/asset/:schemaID/", "title": "Add Asset", - "name": "AssetCreate", - "order": "3", + "name": "CreateAsset", + "order": "2", "description": "

Create an asset

", "group": "Asset_Management", "version": "1.0.0", @@ -21,7 +42,14 @@ { "group": "Body", "type": "string", - "optional": false, + "optional": true, + "field": "number", + "description": "

Asset number.

" + }, + { + "group": "Body", + "type": "string", + "optional": true, "field": "description", "description": "

description of the asset.

" }, @@ -46,6 +74,13 @@ "field": "altitude", "description": "

altitude coordinate

" }, + { + "group": "Body", + "type": "number", + "optional": true, + "field": "clientID", + "description": "

Client ID for existing client.

" + }, { "group": "Body", "type": "client", @@ -58,14 +93,14 @@ "type": "number", "optional": true, "field": "locationID", - "description": "

location ID for existing client locations.

" + "description": "

location ID for existing client location.

" }, { "group": "Body", "type": "number", "optional": true, "field": "zoneID", - "description": "

zone ID for existing client locations.

" + "description": "

zone ID for existing client location zone.

" }, { "group": "Body", @@ -74,13 +109,6 @@ "field": "zone", "description": "

Creates a new zone and attaches it to the existing client location id. If there is no location, no zone will be created.

" }, - { - "group": "Body", - "type": "number", - "optional": true, - "field": "clientID", - "description": "

client ID for existing clients

" - }, { "group": "Body", "type": "json", @@ -113,168 +141,168 @@ "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -284,17 +312,17 @@ "examples": [ { "title": "Request Body Example:", - "content": "{\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", + "content": " {\n \"name\": \"New Asset\",\n \"number\": \"ASSET01\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", "type": "json" }, { "title": "Request Body Example using schema-columns:", - "content": "{\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"content\": {\n \"Barcode ID\": \"QR-6789\",\n \"Area\": \"Bathroom\",\n \"Activity Level\": \"15\",\n \"Replenished (Yes/No)\": \"No\",\n \"Comments\": \"Quick comment.\"\n }\n}", + "content": " {\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"content\": {\n \"Barcode ID\": \"QR-6789\",\n \"Area\": \"Bathroom\",\n \"Activity Level\": \"15\",\n \"Replenished (Yes/No)\": \"No\",\n \"Comments\": \"Quick comment.\"\n }\n}", "type": "json" }, { "title": "Request Body Example with new client", - "content": "{\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"client\": {\n \"billingName\": \"New Customer\",\n \"contact\": [{\n \"firstName\": \"Alex\",\n \"lastName\": \"Jones\",\n \"email\": \"alex.jones@company.net\",\n }],\n \"location\": [{\n \"street1\": \"123 Street name\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }]\n },\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", + "content": " {\n \"name\": \"New Asset\",\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"client\": {\n \"billingName\": \"New Customer\",\n \"contact\": [{\n \"firstName\": \"Alex\",\n \"lastName\": \"Jones\",\n \"email\": \"alex.jones@company.net\",\n }],\n \"location\": [{\n \"street1\": \"123 Street name\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }]\n },\n \"char1\": \"QR-6789\",\n \"char2\": \"Bathroom\",\n \"int1\": \"15\",\n \"char3\": \"No\",\n \"char4\": \"Quick comment.\"\n}", "type": "json" } ] @@ -303,7 +331,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Adadress Sydney 2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n }\n }\n}", + "content": " {\n \"payload\": {\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Address Sydney NSW 2000\",\n \"address1\": \"123 Street Address\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n }\n}", "type": "JSON" } ] @@ -311,214 +339,19 @@ "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", "groupTitle": "Asset_Management" }, - { - "type": "delete", - "url": "/asset/:schemaID/:assetID", - "title": "Delete Asset", - "name": "AssetDelete", - "order": "5", - "description": "

Delete an existing asset.

", - "group": "Asset_Management", - "version": "1.0.0", - "success": { - "examples": [ - { - "title": "CURL Response", - "content": "{\n \"payload\": {\n \"result\": \"deleted\"\n }\n}", - "type": "JSON" - } - ] - }, - "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", - "groupTitle": "Asset_Management", - "parameter": { - "fields": { - "Client Fields": [ - { - "group": "Client Fields", - "type": "Object", - "optional": false, - "field": "client", - "description": "

The Client Object

" - }, - { - "group": "Client Fields", - "type": "Number", - "optional": true, - "field": "client.id", - "description": "

ID of the client.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": false, - "field": "client.billingName", - "description": "

The Billing Name of the client

" - }, - { - "group": "Client Fields", - "type": "Object[]", - "optional": true, - "field": "client.contact", - "description": "

An array of contacts

" - }, - { - "group": "Client Fields", - "type": "Number", - "optional": true, - "field": "client.contact.id", - "description": "

The ID of the client's contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.firstName", - "description": "

First name of contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.lastName", - "description": "

Last name of contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.email", - "description": "

First name of contact.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.mobile", - "description": "

Mobile number.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.mobileAreaCode", - "description": "

Mobile number area code.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.workPhone", - "description": "

Work phone number.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.workPhoneAreaCode", - "description": "

Work phone number area code.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.homePhone", - "description": "

Home phone number.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.contact.homePhoneAreaCode", - "description": "

Home phone number area code.

" - }, - { - "group": "Client Fields", - "type": "Object", - "optional": true, - "field": "client.contact.custom", - "description": "

Object of custom variables.

" - }, - { - "group": "Client Fields", - "type": "Object", - "optional": true, - "field": "client.contact.custom.OBJECT_1", - "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" - }, - { - "group": "Client Fields", - "type": "Object[]", - "optional": true, - "field": "client.location", - "description": "

An array of locations

" - }, - { - "group": "Client Fields", - "type": "Number", - "optional": true, - "field": "client.location.id", - "description": "

The ID of the client's location.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.street1", - "description": "

Street 1 address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.street2", - "description": "

Street 2 address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.city", - "description": "

City address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.state", - "description": "

State address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.postcode", - "description": "

Postcode address.

" - }, - { - "group": "Client Fields", - "type": "String", - "optional": true, - "field": "client.location.country", - "description": "

Country address.

" - } - ] - } - } - }, { "type": "get", "url": "/asset/:schemaID/:assetID", "title": "Get Asset", - "name": "AssetGet", - "order": "5", + "name": "GetAsset", + "order": "3", "description": "

Get available information about the asset.

", "group": "Asset_Management", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/3/520427", "type": "json" } ], @@ -526,7 +359,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\", \n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n } \n ]\n },\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Adadress Sydney 2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n }\n }\n}", + "content": "{\n \"payload\": {\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Asset Name.\",\n \"number\": \"520427\",\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Address Sydney NSW 2000\",\n \"address1\": \"123 Street Address\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n }\n}", "type": "JSON" } ] @@ -536,17 +369,17 @@ }, { "type": "get", - "url": "/asset/list/:schemaID/", - "title": "List Assets", - "name": "AssetList", - "order": "2", - "description": "

Retrieve a list of assets within a schema.

", + "url": "/asset/schema/list", + "title": "List Asset Types", + "name": "ListAssetSchema", + "order": "0", + "description": "

Retrieve a list of asset schemas available.

", "group": "Asset_Management", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/:schemaID", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/", "type": "json" } ], @@ -554,27 +387,27 @@ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\", \n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n } \n ]\n },\n \"results\": [\n {\n \"assetID\": \"520427\",\n \"name\": \"Name of asset\",\n \"description\": \"Description of asset.\",\n \"number\": \"520427\",\n \"schemaID\": \"3\",\n \"date\": \"1599094442\",\n \"latitude\": \"5556\",\n \"longitude\": \"6666\",\n \"clientID\": \"1\",\n \"altitude\": \"777\",\n \"companyName\": \"Client Name\",\n \"address1\": \"123 Street Address\",\n \"address2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n }\n ]\n }\n}", + "content": "{\n \"payload\": [\n {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"ID\",\n \"col\": \"id\"\n },\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n\t\t\t\t\"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n\t\t...\n\t]\n}", "type": "JSON" } ] }, - "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", + "filename": "app/system/class/api/rest/v1/asset/schema/_apidoc.js", "groupTitle": "Asset_Management" }, { "type": "get", - "url": "/asset/schema/list", - "title": "List Asset Types", - "name": "AssetSchemaList", + "url": "/asset/list/:schemaID/", + "title": "List Assets", + "name": "ListAssets", "order": "1", - "description": "

Retrieve a list of asset schemas available.

", + "description": "

Retrieve a list of assets within a schema.

", "group": "Asset_Management", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/asset/schema/list/3", "type": "json" } ], @@ -582,19 +415,19 @@ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": [\n {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"ID\",\n \"col\": \"id\"\n },\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n\t\t\t\t\"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n\t\t...\n\t]\n}", + "content": "{\n \"payload\": {\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n\t\t\t\t\"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n \"results\": [\n {\n \"id\": \"520427\",\n \"companyID\": \"1\",\n \"name\": \"Name of asset\",\n \"description\": \"Description of asset.\",\n \"number\": \"520427\",\n \"schemaID\": \"3\",\n \"date\": \"1599094442\",\n \"latitude\": \"5556\",\n \"longitude\": \"6666\",\n \"clientID\": \"1\",\n \"locationID\": \"5\",\n \"altitude\": \"777\",\n \"companyName\": \"Client Name\",\n \"siteName\": \"\",\n \"address1\": \"123 Street Address\",\n \"address2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"2000\",\n \"state\": \"NSW\",\n \"country\": \"\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n ]\n }\n}", "type": "JSON" } ] }, - "filename": "app/system/class/api/rest/v1/asset/schema/_apidoc.js", + "filename": "app/system/class/api/rest/v1/asset/_apidoc.js", "groupTitle": "Asset_Management" }, { "type": "post", "url": "/asset/:schemaID/:assetID", "title": "Edit Asset", - "name": "AssetUpdate", + "name": "UpdateAsset", "order": "4", "description": "

Update an existing asset.

", "group": "Asset_Management", @@ -605,10 +438,17 @@ { "group": "Body", "type": "string", - "optional": true, + "optional": false, "field": "name", "description": "

Name of the asset.

" }, + { + "group": "Body", + "type": "string", + "optional": true, + "field": "number", + "description": "

Asset number.

" + }, { "group": "Body", "type": "string", @@ -642,21 +482,28 @@ "type": "number", "optional": true, "field": "clientID", - "description": "

client ID for existing clients

" + "description": "

Client ID for existing client.

" + }, + { + "group": "Body", + "type": "client", + "optional": true, + "field": "client", + "description": "

Optional client body for new clients

" }, { "group": "Body", "type": "number", "optional": true, "field": "locationID", - "description": "

location ID for existing client locations.

" + "description": "

location ID for existing client location.

" }, { "group": "Body", "type": "number", "optional": true, "field": "zoneID", - "description": "

zone ID for existing client locations.

" + "description": "

zone ID for existing client location zone.

" }, { "group": "Body", @@ -665,13 +512,6 @@ "field": "zone", "description": "

Creates a new zone and attaches it to the existing client location id. If there is no location, no zone will be created.

" }, - { - "group": "Body", - "type": "client", - "optional": true, - "field": "client", - "description": "

Optional client body for new clients

" - }, { "group": "Body", "type": "json", @@ -704,168 +544,168 @@ "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -894,7 +734,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Updated Asset Name\",\n \"number\": 520427,\n \"description\": \"Description of asset.\",\n \"longitude\": 6666,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Adadress Sydney 2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\"\n },\n \"fieldsUpdated\": {\n \"name\": \"Updated Asset Name\",\n \"description\": \"desc\",\n \"longitude\": \"6666\"\n },\n }\n}", + "content": "{\n \"payload\": {\n \"status\": \"success\",\n \"fieldsUpdated\": {\n \"name\": \"Updated Asset Name\",\n \"description\": \"New Description\",\n \"longitude\": \"1\"\n },\n \"assetID\": \"520427\",\n \"schemaID\": \"3\",\n \"schema\": {\n \"id\": 3,\n \"title\": \"Bait Station\",\n \"columns\": [\n {\n \"title\": \"Barcode ID\",\n \"col\": \"char1\"\n },\n {\n \"title\": \"Area\",\n \"col\": \"char2\"\n },\n {\n \"title\": \"Activity Level\",\n \"col\": \"int1\"\n },\n {\n \"title\": \"Replenished (Yes/No)\",\n \"col\": \"char3\"\n },\n {\n \"title\": \"Comments\",\n \"col\": \"char4\"\n }\n ],\n \"actions\": {\n \"list\": \"GET https://service.formitize.com/api/rest/v2/asset/3/list\",\n \"getAsset\": \"GET https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"updateAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/:assetid\",\n \"createAsset\": \"POST https://service.formitize.com/api/rest/v2/asset/3/\"\n }\n },\n \"asset\": {\n \"id\": 520427,\n \"name\": \"Updated Asset Name\",\n \"number\": 520427,\n \"description\": \"New Description\",\n \"longitude\": 1,\n \"latitude\": 5556,\n \"altitude\": 777,\n \"clientID\": 1,\n \"locationID\": 1,\n \"zoneID\": 20,\n \"clientName\": \"Client Name\",\n \"location\": \"123 Street Address Sydney NSW 2000\",\n \"address1\": \"123 Street Address\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"postcode\": \"2000\",\n \"zoneValue\": \"Kitchen\",\n \"char1\": \"QR-12345\",\n \"char2\": \"Sink\",\n \"int1\": \"10\",\n \"char3\": \"Yes\",\n \"char4\": \"The comment of this asset.\",\n \"content\": {\n \"ID\": \"520427\",\n \"Barcode ID\": \"QR-12345\",\n \"Area\": \"Sink\",\n \"Activity Level\": \"10\",\n \"Replenished (Yes/No)\": \"Yes\",\n \"Comments\": \"The comment of this asset.\"\n }\n }\n }\n}", "type": "JSON" } ] @@ -918,14 +758,14 @@ "CURL Authorisation": [ { "group": "CURL Authorisation", - "type": "String", + "type": "string", "optional": false, "field": "--user-agent", "description": "

This is the company login name used on Formitize e.g. "Formitize"

" }, { "group": "CURL Authorisation", - "type": "String", + "type": "string", "optional": false, "field": "--u", "description": "

This will be the user:password b64 encrypted e.g. Username123:password123

" @@ -954,7 +794,7 @@ "examples": [ { "title": "Authorisation Errors", - "content": "{\"payload\":{\"error\": {\"message\": \"Username does not exist.\", \"timestamp\": 1521691072, \"code\": 401}}}", + "content": "{\n \"payload\": {\n \"error\": {\n \"message\": \"Invalid company/user/password.\",\n \"timestamp\": 1679273891,\n \"code\": 401\n }\n }\n}", "type": "json" } ] @@ -962,10 +802,10 @@ }, { "type": "Post", - "url": "/crm/client/:id/contact/", + "url": "/crm/client/:clientID/contact/", "title": "Add Contact", "name": "AddContact", - "order": "7", + "order": "6", "group": "CRM", "version": "1.0.0", "parameter": { @@ -973,84 +813,84 @@ "Contact Fields": [ { "group": "Contact Fields", - "type": "Number", + "type": "number", "optional": true, "field": "id", "description": "

The ID of the client's contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "firstName", "description": "

First name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "lastName", "description": "

Last name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "email", "description": "

First name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobile", "description": "

Mobile number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhone", "description": "

Work phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhone", "description": "

Home phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom", "description": "

Object of custom variables.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" @@ -1069,7 +909,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"type\": \"Email\",\n \"value\": \"john.doe@example.com\"\n }\n ]\n }\n ]\n}", + "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n ]\n}", "type": "json" } ] @@ -1079,10 +919,10 @@ }, { "type": "Delete", - "url": "/crm/client/:id", + "url": "/crm/client/:clientID", "title": "Delete Client", "name": "DeleteClient", - "order": "5", + "order": "4", "group": "CRM", "version": "1.0.0", "examples": [ @@ -1123,7 +963,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Deleted\"\n }\n ]\n}", + "content": "{\n \"payload\": [\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Deleted\"\n ]\n}", "type": "json" } ] @@ -1144,83 +984,90 @@ "Contact Fields": [ { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "firstName", "description": "

First name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "lastName", "description": "

Last name of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "email", - "description": "

First name of contact.

" + "description": "

Email address of contact.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobile", "description": "

Mobile number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhone", "description": "

Work phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhone", "description": "

Home phone number.

" }, { "group": "Contact Fields", - "type": "String", + "type": "string", "optional": true, "field": "homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom", "description": "

Object of custom variables.

" }, { "group": "Contact Fields", - "type": "Object", + "type": "object", "optional": true, "field": "custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" } ] - } + }, + "examples": [ + { + "title": "Request Body Example:", + "content": " {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"mobile\": \"0123 456 789\",\n \"mobileAreaCode\": \"+61\"\n}", + "type": "json" + } + ] }, "examples": [ { @@ -1233,7 +1080,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"type\": \"Email\",\n \"value\": \"john.doe@example.com\"\n }\n ]\n }\n ]\n}", + "content": "{\n \"payload\": {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0123 456 789\",\n \"mobileAreaCode\": \"+61\"\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n}", "type": "json" } ] @@ -1243,7 +1090,7 @@ }, { "type": "Get", - "url": "/crm/client/:id", + "url": "/crm/client/:clientID", "title": "Get Client", "name": "GetClient", "order": "2", @@ -1260,7 +1107,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryContactPhone\": \"0000 000 000\",\n \"primaryContactEmail\": \"jane.doe@example.com\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contact\": {\n \"80\": {\n \"id\": \"80\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {}\n },\n \"81\": {\n \"id\": \"81\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {}\n }\n },\n \"location\": {\n \"79\": {\n \"id\": 79,\n \"street1\": \"STREET_1\",\n \"street2\": \"STREET_2\",\n \"city\": \"CITY\",\n \"state\": \"STATE\",\n \"postcode\": \"\",\n \"country\": \"AUSTRALIA\",\n \"zones\": [\n {\n \"id\": \"1\",\n \"value\": \"Zone A\"\n },\n {\n \"id\": \"2\",\n \"value\": \"Zone B\"\n }\n ],\n \"custom\": \"[]\"\n }\n }\n }\n}", + "content": " {\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactID\": \"80\",\n \"primaryAddressID\": \"79\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryContactPhone\": \"0000 000 000\",\n \"primaryContactEmail\": \"jane.doe@example.com\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contact\": [\n {\n \"id\": \"80\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {}\n },\n {\n \"id\": \"81\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": {\n \"24\": {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n }\n }\n ],\n \"location\": [\n {\n \"id\": 79,\n \"sitename\": false,\n \"street1\": \"STREET_1\",\n \"street2\": \"STREET_2\",\n \"city\": \"CITY\",\n \"state\": \"STATE\",\n \"postcode\": \"\",\n \"country\": \"AUSTRALIA\",\n \"zones\": [\n {\n \"id\": \"1\",\n \"value\": \"Zone A\"\n },\n {\n \"id\": \"2\",\n \"value\": \"Zone B\"\n }\n ],\n \"custom\": {}\n }\n ]\n }\n}", "type": "json" } ] @@ -1270,12 +1117,52 @@ }, { "type": "Get", - "url": "/crm/client/:id/contact/", - "title": "Get Contacts", + "url": "/crm/client/:clientID/contact/:contactID", + "title": "Get Contact", "name": "GetContact", - "order": "6", + "order": "7", + "group": "CRM", + "version": "1.0.0", + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/client/77/contact/78", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": " {\n \"payload\": {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/crm/client/_apidoc.js", + "groupTitle": "CRM" + }, + { + "type": "Get", + "url": "/crm/client/:clientID/contact/", + "title": "List Contacts", + "name": "ListContact", + "order": "5", "group": "CRM", "version": "1.0.0", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + } + ] + } + }, "examples": [ { "title": "CURL Example", @@ -1287,7 +1174,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"78\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"\",\n \"mobileAreaCode\": \"\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"john.doe@example.com\",\n \"custom\": [\n {\n \"type\": \"Email\",\n \"value\": \"john.doe@example.com\"\n }\n ]\n }\n ]\n}", + "content": "{\n \"payload\": [\n {\n \"id\": \"80\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": []\n },\n {\n \"id\": \"81\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"homePhone\": \"\",\n \"homePhoneAreaCode\": \"\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"workPhone\": \"\",\n \"workPhoneAreaCode\": \"\",\n \"email\": \"\",\n \"custom\": [\n {\n \"id\": \"24\",\n \"type\": \"Mobile\",\n \"value\": \"0000 000 000\",\n \"extra\": \"+61\",\n \"datatype\": \"\"\n }\n ]\n }\n ]\n}", "type": "json" } ] @@ -1297,7 +1184,7 @@ }, { "type": "Get", - "url": "/crm/client/list/?page=1", + "url": "/crm/client/list/", "title": "List Clients", "description": "

List all the contacts and clients available, returns 500 at a time.

", "name": "ListContactsClient", @@ -1310,7 +1197,7 @@ { "group": "Optional", "type": "number", - "optional": false, + "optional": true, "field": "page", "description": "

The page number, starting from 1.

" } @@ -1328,7 +1215,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"93\",\n \"billingName\": \"Business Name\",\n \"name\": \"Jane Doe\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": {\n \"110\": {\n \"id\": \"110\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n },\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"94\",\n \"billingName\": \"Business Name\",\n \"name\": \"John Doe\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": {\n \"111\": {\n \"id\": \"111\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n },\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"67\",\n \"clientID\": \"67\",\n \"contactID\": \"67\",\n \"billingName\": \"Formitize\",\n \"name\": \"SUPPORT\",\n \"firstName\": \"SUPPORT\",\n \"lastName\": \"\",\n \"status\": \"Active\",\n \"clientType\": \"\",\n \"primaryAddress\": \"Rodeo Rd, Gregory Hills\",\n \"cachedata\": {\n \"84\": {\n \"id\": \"84\",\n \"type\": \"Email\",\n \"extra\": \"\",\n \"value\": \"support@formitize.com\",\n \"datatype\": \"\"\n },\n \"85\": {\n \"id\": \"85\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0400 000 000\",\n \"datatype\": \"\"\n },\n \"86\": {\n \"id\": \"86\",\n \"type\": \"Work Phone\",\n \"extra\": \"\",\n \"value\": \"1300 552 008\",\n \"datatype\": \"\"\n }\n },\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n }\n ]\n}", + "content": "{\n \"payload\": [\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"93\",\n \"billingName\": \"Business Name\",\n \"name\": \"Jane Doe\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": [\n {\n \"id\": \"110\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n ],\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"87\",\n \"clientID\": \"87\",\n \"contactID\": \"94\",\n \"billingName\": \"Business Name\",\n \"name\": \"John Doe\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"status\": \"Active\",\n \"clientType\": \"Customer\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"cachedata\": [\n {\n \"id\": \"111\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0000 000 000\",\n \"datatype\": \"\"\n }\n ],\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n },\n {\n \"id\": \"67\",\n \"clientID\": \"67\",\n \"contactID\": \"67\",\n \"billingName\": \"Formitize\",\n \"name\": \"SUPPORT\",\n \"firstName\": \"SUPPORT\",\n \"lastName\": \"\",\n \"status\": \"Active\",\n \"clientType\": \"\",\n \"primaryAddress\": \"Rodeo Rd, Gregory Hills\",\n \"cachedata\": [\n {\n \"id\": \"84\",\n \"type\": \"Email\",\n \"extra\": \"\",\n \"value\": \"support@formitize.com\",\n \"datatype\": \"\"\n },\n {\n \"id\": \"85\",\n \"type\": \"Mobile\",\n \"extra\": \"+61\",\n \"value\": \"0400 000 000\",\n \"datatype\": \"\"\n },\n {\n \"id\": \"86\",\n \"type\": \"Work Phone\",\n \"extra\": \"\",\n \"value\": \"1300 552 008\",\n \"datatype\": \"\"\n }\n ],\n \"latestNote\": \"\",\n \"dateCreated\": \"1603943584\",\n \"dateModified\": \"1603943584\"\n }\n ]\n}", "type": "json" } ] @@ -1351,161 +1238,161 @@ "Client Fields": [ { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.country", "description": "

Country address.

" @@ -1524,7 +1411,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", + "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", "type": "json" } ] @@ -1532,10 +1419,10 @@ }, { "type": "post", - "url": "/crm/client/:id", + "url": "/crm/client/:clientID", "title": "Edit Client", "name": "PostEditClient", - "order": "2", + "order": "3", "group": "CRM", "version": "1.0.0", "filename": "app/system/class/api/rest/v1/crm/client/_apidoc.js", @@ -1545,161 +1432,161 @@ "Client Fields": [ { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "location.country", "description": "

Country address.

" @@ -1718,7 +1605,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", + "content": "{\n \"payload\": {\n \"id\": \"77\",\n \"billingName\": \"Business Name\",\n \"primaryContactID\": 80,\n \"primaryAddressID\": 79,\n \"primaryContactName\": \"Jane Doe\",\n \"primaryAddress\": \"STREET_1 STREET_2, CITY STATE, AUSTRALIA\",\n \"contactIDs\": [\n 80,\n 81\n ],\n \"locationIDs\": [\n 79\n ]\n }\n}", "type": "json" } ] @@ -1743,7 +1630,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": 226,\n \"invoiceNumber\": \"INVF-05932\",\n \"invoiceDate\": \"04th Jun 2020\",\n \"client\": {\n \"id\": 103,\n \"billingName\": \"My Contact\"\n },\n \"orderNumber\": \"\",\n \"referenceNumber\": \"\",\n \"addressTo\": \"\",\n \"currency\": \"AUD\",\n \"status\": \"Open\",\n \"type\": \"ACCREC\",\n \"lineItems\": [\n {\n \"id\": \"274\",\n \"code\": \"\",\n \"description\": \"3333\",\n \"quantity\": \"1\",\n \"unitAmount\": \"44\",\n \"discountPercentage\": \"0\",\n \"lineSubtotal\": 40,\n \"taxAmount\": 4,\n \"lineTotal\": 44\n }\n ],\n \"taxType\": \"INCLUSIVE\",\n \"tax\": 4,\n \"subtotal\": 40,\n \"total\": 44,\n \"amountPaid\": 0,\n \"payments\": [],\n \"history\": [\n {\n \"by\": \"User\",\n \"userName\": \"Sam John\",\n \"note\": \"Added 1 row.\",\n \"date\": \"11th Aug 2022 11:26am\",\n \"dateTimestamp\": \"1660181216\"\n }\n ]\n }\n}", + "content": "{\n \"payload\": {\n \"id\": 226,\n \"invoiceNumber\": \"INVF-05932\",\n \"invoiceDate\": 1591192800,\n \"invoiceDateFormatted\": \"04th Jun 2020\",\n \"expectedPayDate\": 1591192800,\n \"expectedPayDateFormatted\": \"04th Jun 2020\",\n \"clientID\": 103,\n \"companyName\": \"My Contact\",\n \"primaryAddress\": \"1234 Abc Street\",\n \"primaryContactName\": \"Jeff\",\n \"primaryContactPhone\": \"0410 000 000\",\n \"primaryContactEmail\": \"test@email.com\",\n \"client\": {\n \"id\": 103,\n \"billingName\": \"My Contact\"\n },\n \"contact\": {\n \"name\": \"Invoice Contact\",\n \"email\": \"other@test.com\",\n \"mobile\": \"0420 000 000\"\n },\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"addressTo\": \"\",\n \"currency\": \"AUD\",\n \"status\": \"Open\",\n \"type\": \"ACCREC\",\n \"lineItems\": [\n {\n \"id\": \"274\",\n \"code\": \"\",\n \"description\": \"3333\",\n \"quantity\": \"1\",\n \"unitAmount\": \"44\",\n \"discountPercentage\": \"0\",\n \"lineSubtotal\": 40,\n \"taxAmount\": 4,\n \"lineTotal\": 44\n }\n ],\n \"taxType\": \"INCLUSIVE\",\n \"tax\": 4,\n \"subtotal\": 40,\n \"total\": 44,\n \"amountPaid\": 0,\n \"payments\": [],\n \"pdfUrl\": \"https://service.formitize.com/s/xxxx-xxxx-xxxx-xxxx\",\n \"attachedTo\": {\n \"job\": [\n 20000,\n 30000,\n 31353\n ],\n \"quote\": [\n \"QU-001\",\n \"QU-002\"\n ]\n },\n \"history\": [\n {\n \"by\": \"User\",\n \"userName\": \"Sam John\",\n \"note\": \"Added 1 row.\",\n \"date\": \"11th Aug 2022 11:26am\",\n \"dateTimestamp\": \"1660181216\"\n }\n ]\n }\n}", "type": "json" } ] @@ -1751,14 +1638,142 @@ "filename": "app/system/class/api/rest/v1/crm/accounts/invoice/_apidoc.js", "groupTitle": "CRM_Accounts" }, + { + "type": "Get", + "url": "/crm/accounts/quote/:id", + "title": "Get Quote", + "name": "GetQuote", + "order": "1", + "group": "CRM_Accounts", + "version": "1.0.0", + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/accounts/quote/77", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": "{\n \"payload\": {\n \"id\": 226,\n \"quoteNumber\": \"INVF-05932\",\n \"quoteDate\": 1591192800,\n \"quoteDateFormatted\": \"04th Jun 2020\",\n \"clientID\": 103,\n \"companyName\": \"My Contact\",\n \"primaryAddress\": \"1234 Abc Street\",\n \"primaryContactName\": \"Jeff\",\n \"primaryContactPhone\": \"0410 000 000\",\n \"primaryContactEmail\": \"test@email.com\",\n \"client\": {\n \"id\": 103,\n \"billingName\": \"My Contact\"\n },\n \"contact\": {\n \"name\": \"Quote Contact\",\n \"email\": \"other@test.com\",\n \"mobile\": \"0420 000 000\"\n },\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"addressTo\": \"\",\n \"currency\": \"AUD\",\n \"status\": \"Open\",\n \"type\": \"ACCREC\",\n \"lineItems\": [\n {\n \"id\": \"274\",\n \"code\": \"\",\n \"description\": \"3333\",\n \"quantity\": \"1\",\n \"unitAmount\": \"44\",\n \"discountPercentage\": \"0\",\n \"lineSubtotal\": 40,\n \"taxAmount\": 4,\n \"lineTotal\": 44\n }\n ],\n \"taxType\": \"INCLUSIVE\",\n \"tax\": 4,\n \"subtotal\": 40,\n \"total\": 44,\n \"amountPaid\": 0,\n \"pdfUrl\": \"https://service.formitize.com/s/xxxx-xxxx-xxxx-xxxx\",\n \"attachedTo\": {\n \"job\": [\n 20000,\n 30000,\n 31353\n ],\n \"quote\": [\n \"QU-001\",\n \"QU-002\"\n ]\n },\n \"history\": [\n {\n \"by\": \"User\",\n \"userName\": \"Sam John\",\n \"note\": \"Added 1 row.\",\n \"date\": \"11th Aug 2022 11:26am\",\n \"dateTimestamp\": \"1660181216\"\n }\n ]\n }\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/crm/accounts/quote/_apidoc.js", + "groupTitle": "CRM_Accounts" + }, { "type": "Get", "url": "/crm/accounts/invoice/list", - "title": "List Invoice", + "title": "List Invoices", "name": "ListInvoice", + "description": "

List invoices available, returns 500 at a time.

", "order": "0", "group": "CRM_Accounts", "version": "1.0.0", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "limit", + "description": "

The number of rows returned. Default is 500.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "clientID", + "description": "

List invoices with the specified Client ID.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"0,1\"" + ], + "optional": true, + "field": "status", + "description": "

List invoices matching the specified status. 0 = Draft, 1 = Open, 3 = Cancelled.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"2\"", + "\"1,2\"" + ], + "optional": true, + "field": "paymentstatus", + "description": "

List invoices matching the specified payment status. 1 = Unpaid, 2 = Paid, 3 = Overdue, 5 = Expired.

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "value", + "description": "

Search for invoices that contain the specified search value. Fields included in search are quoteNumber, orderNumber, addressTo, reference, invoiceNumber, leadId, title, companyName, primaryContactName, primaryContactEmail

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-from", + "description": "

List invoices created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-to", + "description": "

List invoices created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "invoicedate-from", + "description": "

List invoices with invoice date on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "invoicedate-to", + "description": "

List invoices with invoice date on or after the given date.

" + } + ] + } + }, "examples": [ { "title": "CURL Example", @@ -1770,7 +1785,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [\n {\n \"id\": \"485\",\n \"addressTo\": \"5553 New Canterbury Road, Dulwich Hill New South Wales 2203, Australia\",\n \"clientID\": \"103\",\n \"total\": \"0\",\n \"subtotal\": \"0\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-00115\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"0\",\n \"status\": \"Draft\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"1\",\n \"taxType\": \"INCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661090400\",\n \"expectedPayDateFormatted\": \"22nd Aug 2022\",\n \"invoiceDate\": \"1660831200\",\n \"invoiceDateFormatted\": \"19th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Made on Xero\",\n \"primaryAddress\": \"11 Rodeo Rd, Gregory Hills NSW 2557\",\n \"primaryContact\": \"103\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n },\n {\n \"id\": \"483\",\n \"addressTo\": \"\",\n \"clientID\": \"80\",\n \"total\": \"5\",\n \"subtotal\": \"5\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-0343\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"1\",\n \"status\": \"Open\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"2\",\n \"taxType\": \"EXCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661263200\",\n \"expectedPayDateFormatted\": \"24th Aug 2022\",\n \"invoiceDate\": \"1660053600\",\n \"invoiceDateFormatted\": \"10th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Test\",\n \"primaryAddress\": \"George Street, Sydney, NSW 2000\",\n \"primaryContact\": \"80\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n }\n ]\n}", + "content": " {\n \"payload\": [\n {\n \"id\": \"485\",\n \"addressTo\": \"5553 New Canterbury Road, Dulwich Hill New South Wales 2203, Australia\",\n \"clientID\": \"103\",\n \"total\": \"0\",\n \"subtotal\": \"0\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-00115\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"0\",\n \"status\": \"Draft\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"1\",\n \"taxType\": \"INCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661090400\",\n \"expectedPayDateFormatted\": \"22nd Aug 2022\",\n \"invoiceDate\": \"1660831200\",\n \"invoiceDateFormatted\": \"19th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Made on Xero\",\n \"primaryAddress\": \"11 Rodeo Rd, Gregory Hills NSW 2557\",\n \"primaryContact\": \"103\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n },\n {\n \"id\": \"483\",\n \"addressTo\": \"\",\n \"clientID\": \"80\",\n \"total\": \"5\",\n \"subtotal\": \"5\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"invoiceNumber\": \"INV-0343\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"1\",\n \"status\": \"Open\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"2\",\n \"taxType\": \"EXCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"payDate\": \"0\",\n \"payDateFormatted\": \"\",\n \"expectedPayDate\": \"1661263200\",\n \"expectedPayDateFormatted\": \"24th Aug 2022\",\n \"invoiceDate\": \"1660053600\",\n \"invoiceDateFormatted\": \"10th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Test\",\n \"primaryAddress\": \"George Street, Sydney, NSW 2000\",\n \"primaryContact\": \"80\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n }\n ]\n}", "type": "json" } ] @@ -1778,12 +1793,129 @@ "filename": "app/system/class/api/rest/v1/crm/accounts/invoice/_apidoc.js", "groupTitle": "CRM_Accounts" }, + { + "type": "Get", + "url": "/crm/accounts/quote/list", + "title": "List Quotes", + "name": "ListQuote", + "description": "

List quotes available, returns 500 at a time.

", + "order": "0", + "group": "CRM_Accounts", + "version": "1.0.0", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "limit", + "description": "

The number of rows returned. Default is 500.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "clientID", + "description": "

List quotes with the specified Client ID.

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "value", + "description": "

Search for quotes that contain the specified search value.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"1,2\"" + ], + "optional": true, + "field": "status", + "description": "

List quotes matching the specified status. 1 = Open, 2 = Accepted, 3 = Lost, 4 = Closed.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-from", + "description": "

List quotes created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "datecreated-to", + "description": "

List quotes created on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "quotedate-from", + "description": "

List quotes with quote date on or after the given date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "quotedate-to", + "description": "

List quotes with quote date on or after the given date.

" + } + ] + } + }, + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/accounts/quote/list", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": " {\n \"payload\": [\n {\n \"id\": \"485\",\n \"addressTo\": \"5553 New Canterbury Road, Dulwich Hill New South Wales 2203, Australia\",\n \"clientID\": \"103\",\n \"total\": \"0\",\n \"subtotal\": \"0\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"quoteNumber\": \"QU-00115\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"0\",\n \"status\": \"Draft\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"1\",\n \"taxType\": \"INCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"quoteDate\": \"1660831200\",\n \"quoteDateFormatted\": \"19th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Made on Xero\",\n \"primaryAddress\": \"11 Rodeo Rd, Gregory Hills NSW 2557\",\n \"primaryContact\": \"103\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n },\n {\n \"id\": \"483\",\n \"addressTo\": \"\",\n \"clientID\": \"80\",\n \"total\": \"5\",\n \"subtotal\": \"5\",\n \"tax\": \"0\",\n \"type\": \"0\",\n \"amountPaid\": \"0\",\n \"quoteNumber\": \"INV-0343\",\n \"orderNumber\": \"\",\n \"reference\": \"\",\n \"statusValue\": \"1\",\n \"status\": \"Open\",\n \"currency\": \"AUD\",\n \"taxTypeValue\": \"2\",\n \"taxType\": \"EXCLUSIVE\",\n \"paid\": \"0\",\n \"title\": \"\",\n \"summary\": \"\",\n \"terms\": \"\",\n \"attachedTo\": [],\n \"quoteDate\": \"1660053600\",\n \"quoteDateFormatted\": \"10th Aug 2022\",\n \"lastEmailed\": \"0\",\n \"lastEmailedFormatted\": \"\",\n \"companyname\": \"Test\",\n \"primaryAddress\": \"George Street, Sydney, NSW 2000\",\n \"primaryContact\": \"80\",\n \"primaryContactName\": \"Support\",\n \"primaryContactPhone\": \"1300 552 008\",\n \"primaryContactEmail\": \"support@formitize.com\"\n }\n ]\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/crm/accounts/quote/_apidoc.js", + "groupTitle": "CRM_Accounts" + }, { "type": "Delete", "url": "/crm/client/:clientid/location/:locationid", "title": "Delete Location", "name": "DeleteClientLocation", - "order": "5", + "order": "4", "group": "CRM_Location", "version": "1.0.0", "examples": [ @@ -1851,7 +1983,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": {\n \"id\": \"80\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }\n}", + "content": " {\n \"payload\": {\n \"id\": \"80\",\n \"siteName\": \"\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }\n}", "type": "json" } ] @@ -1862,15 +1994,15 @@ { "type": "Get", "url": "/crm/client/:clientid/location/", - "title": "Get Locations", - "name": "GetClientLocations", - "order": "2", + "title": "List Locations", + "name": "ListClientLocations", + "order": "0", "group": "CRM_Location", "version": "1.0.0", "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/client/77/locations", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/crm/client/77/location", "type": "json" } ], @@ -1878,7 +2010,7 @@ "examples": [ { "title": "Response Body Example:", - "content": "{\n \"payload\": [{\n \"id\": \"80\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n },\n {\n \"id\": \"84\",\n \"street1\": \"456 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n },\n ...]\n}", + "content": " {\n \"payload\": [\n {\n \"id\": \"80\",\n \"siteName\": \"\",\n \"street1\": \"123 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n },\n {\n \"id\": \"84\",\n \"siteName\": \"\",\n \"street1\": \"456 Homer Street\",\n \"street2\": \"\",\n \"city\": \"Sydney\",\n \"postcode\": \"\",\n \"state\": \"NSW\",\n \"country\": \"Australia\"\n }\n ]\n}", "type": "json" } ] @@ -1899,42 +2031,49 @@ "Location Fields": [ { "group": "Location Fields", - "type": "String", + "type": "string", + "optional": true, + "field": "siteName", + "description": "

Site name.

" + }, + { + "group": "Location Fields", + "type": "string", "optional": true, "field": "street1", "description": "

Street 1 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "street2", "description": "

Street 2 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "city", "description": "

City address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "state", "description": "

State address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "postcode", "description": "

Postcode address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "country", "description": "

Country address.

" @@ -1959,7 +2098,7 @@ "url": "/crm/client/:clientid/location/:locationid", "title": "Edit Location", "name": "PostEditClientLocation", - "order": "2", + "order": "3", "group": "CRM_Location", "version": "1.0.0", "parameter": { @@ -1967,42 +2106,49 @@ "Location Fields": [ { "group": "Location Fields", - "type": "String", + "type": "string", + "optional": true, + "field": "siteName", + "description": "

Site name.

" + }, + { + "group": "Location Fields", + "type": "string", "optional": true, "field": "street1", "description": "

Street 1 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "street2", "description": "

Street 2 address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "city", "description": "

City address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "state", "description": "

State address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "postcode", "description": "

Postcode address.

" }, { "group": "Location Fields", - "type": "String", + "type": "string", "optional": true, "field": "country", "description": "

Country address.

" @@ -2022,6 +2168,34 @@ "filename": "app/system/class/api/rest/v1/crm/client/_apidoc.location.js", "groupTitle": "CRM_Location" }, + { + "type": "delete", + "url": "/database/:tablename/all", + "title": "Delete Data From A Table", + "name": "DatabaseDelete", + "order": "3", + "description": "

Delete all records from a specified table.

", + "group": "Database", + "version": "1.0.0", + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"DELETE\" https://service.formitize.com/api/rest/v2/database/example_table/all", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "Response Body Example:", + "content": "{\n\"payload\": {\n\"result\": \"success\",\n\"note\": \"Database records deleted.\"\n}\n}", + "type": "json" + } + ] + }, + "filename": "app/system/class/api/rest/v1/database/_apidoc.js", + "groupTitle": "Database" + }, { "type": "get", "url": "/database/list", @@ -2047,7 +2221,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t...,\n\t\t\"128876\": {\n\t\t\t\"id\": \"128876\",\n\t\t\t\"name\": \"database_test\",\n\t\t\t\"title\": \"\",\n\t\t\t\"dateModified\": \"1590392617\",\n\t\t\t\"storeOnPhone\": \"1\",\n\t\t\t\"columns\": [\n\t\t\t\t\"id\",\n\t\t\t\t\"ColumnA\",\n\t\t\t\t\"ColumnB\",\n\t\t\t\t\"ColumnC\"\n\t\t\t],\n\t\t\t\"url\": \"https://service.formitize.com/api/rest/v2/database/example_table\"\t\t\t\n\t\t},\n\t\t...\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t...,\n\t\t\"128876\": {\n\t\t\t\"id\": \"128876\",\n\t\t\t\"name\": \"database_test\",\n\t\t\t\"title\": \"\",\n\t\t\t\"dateModified\": \"1590392617\",\n\t\t\t\"dateTruncated\": \"0\",\n \"deleted\": \"0\",\n \"type\": \"2\",\n\t\t\t\"storeOnPhone\": \"1\",\n\t\t\t\"config\": \"[]\",\n\t\t\t\"columns\": [\n\t\t\t\t\"id\",\n\t\t\t\t\"ColumnA\",\n\t\t\t\t\"ColumnB\",\n\t\t\t\t\"ColumnC\"\n\t\t\t],\n\t\t\t\"url\": \"https://service.formitize.com/api/rest/v2/database/example_table\"\n\t\t},\n\t\t...\n\t}\n}", "type": "JSON" } ] @@ -2077,9 +2251,9 @@ { "group": "Body", "type": "json", - "optional": false, + "optional": true, "field": "pk", - "description": "

Optional, list of primary keys used to match content when insert/updating values.

" + "description": "

List of primary keys used to match content when insert/updating values.

" } ] } @@ -2121,15 +2295,15 @@ "Optional": [ { "group": "Optional", - "type": "Boolean", - "optional": false, + "type": "boolean", + "optional": true, "field": "simple", "description": "

If true, only returns a list of objects with no form-schema data.

" }, { "group": "Optional", - "type": "Number", - "optional": false, + "type": "number", + "optional": true, "field": "id", "description": "

If a form ID is known, then return information about that form.

" } @@ -2147,12 +2321,12 @@ "examples": [ { "title": "CURL Response (simple)", - "content": "{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\"\n\t\t},\n\t\t\"35624\": {\n\t\t\t\"formID\": \"35624\",\n\t\t\t\"title\": \"Sample Form\"\n\t\t},\n\t\t\"35634\": {\n\t\t\t\"formID\": \"35634\",\n\t\t\t\"title\": \"Client Questionaire\"\n\t\t}\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114\n\t\t},\n\t\t\"35624\": {\n\t\t\t\"formID\": \"35624\",\n\t\t\t\"title\": \"Sample Form\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114\n\t\t},\n\t\t\"35634\": {\n\t\t\t\"formID\": \"35634\",\n\t\t\t\"title\": \"Client Questionaire\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114\n\t\t}\n\t}\n}", "type": "JSON" }, { "title": "CURL Response (with form schema)", - "content": "\n{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"elements\": {\n\t\t\t\t\"formSubheader_1\": {\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"register_1\": {\n\t\t\t\t\t\t\t\"name\": \"register_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formRow_1\": {\n\t\t\t\t\t\t\t\"name\": \"formRow_1\",\n\t\t\t\t\t\t\t\"type\": \"formRow\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formAsset_2\": {\n\t\t\t\t\t\t\t\"name\": \"formAsset_2\",\n\t\t\t\t\t\t\t\"type\": \"formAsset\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formGPS_1\": {\n\t\t\t\t\t\t\t\"name\": \"formGPS_1\",\n\t\t\t\t\t\t\t\"type\": \"formGPS\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRM_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRM_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRM\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_5\": {\n\t\t\t\t\t\t\t\"name\": \"formText_5\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_6\": {\n\t\t\t\t\t\t\t\"name\": \"formText_6\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formPageSplit_1\": {\n\t\t\t\t\t\t\t\"name\": \"formPageSplit_1\",\n\t\t\t\t\t\t\t\"type\": \"formPageSplit\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRMLocation_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRMLocation_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRMLocation\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_7\": {\n\t\t\t\t\t\t\t\"name\": \"formText_7\",\n\t\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", + "content": "\n{\n\t\"payload\": {\n\t\t\"1\": {\n\t\t\t\"formID\": \"1\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"dateModified\": 1642224380,\n\t\t\t\"dateCreated\": 1441184114,\n\t\t\t\"elements\": {\n\t\t\t\t\"formSubheader_1\": {\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"register_1\": {\n\t\t\t\t\t\t\t\"name\": \"register_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 3\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formRow_1\": {\n\t\t\t\t\t\t\t\"name\": \"formRow_1\",\n\t\t\t\t\t\t\t\"type\": \"formRow\",\n\t\t\t\t\t\t\t\"id\": 4\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formAsset_2\": {\n\t\t\t\t\t\t\t\"name\": \"formAsset_2\",\n\t\t\t\t\t\t\t\"type\": \"formAsset\",\n\t\t\t\t\t\t\t\"id\": 5\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formGPS_1\": {\n\t\t\t\t\t\t\t\"name\": \"formGPS_1\",\n\t\t\t\t\t\t\t\"type\": \"formGPS\",\n\t\t\t\t\t\t\t\"id\": 6\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRM_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRM_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRM\",\n\t\t\t\t\t\t\t\"id\": 7\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_5\": {\n\t\t\t\t\t\t\t\"name\": \"formText_5\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 8\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_6\": {\n\t\t\t\t\t\t\t\"name\": \"formText_6\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 9\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formPageSplit_1\": {\n\t\t\t\t\t\t\t\"name\": \"formPageSplit_1\",\n\t\t\t\t\t\t\t\"type\": \"formPageSplit\",\n\t\t\t\t\t\t\t\"id\": 10\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"id\": 11\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formCRMLocation_1\": {\n\t\t\t\t\t\t\t\"name\": \"formCRMLocation_1\",\n\t\t\t\t\t\t\t\"type\": \"formCRMLocation\",\n\t\t\t\t\t\t\t\"id\": 12\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"formText_7\": {\n\t\t\t\t\t\t\t\"name\": \"formMultiple_1\",\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"id\": 13,\n\t\t\t\t\t\t\t\"options\": {\n \"0\": \"-\",\n \"1\": \"Option A\",\n \"2\": \"Option B\",\n \"3\": \"Option C\"\n }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t...\n\t\t\t}\n\t\t}\n\t}\n}", "type": "JSON" } ] @@ -2170,13 +2344,13 @@ "order": "2", "parameter": { "fields": { - "Arguements": [ + "Optional": [ { - "group": "Arguements", - "type": "Number", - "optional": false, - "field": "id", - "description": "

Return information about that form template.

" + "group": "Optional", + "type": "boolean", + "optional": true, + "field": "simple", + "description": "

If true, returns simplified details with no form-schema data.

" } ] } @@ -2192,7 +2366,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t\"formID\": \"35634\",\n\t\t\"title\": \"UPPERCASE_TEST\",\n\t\t\"elements\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\"children\": {\n\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_2\": {\n\t\t\t\t\t\t\"name\": \"formText_2\",\n\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_3\": {\n\t\t\t\t\t\t\"name\": \"formText_3\",\n\t\t\t\t\t\t\"type\": \"formText\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"formID\": \"35634\",\n\t\t\"title\": \"UPPERCASE_TEST\",\n\t\t\"dateModified\": 1642224380,\n \"dateCreated\": 1441184114,\n\t\t\"elements\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\"id\": 2,\n\t\t\t\t\"children\": {\n\t\t\t\t\t\"formText_1\": {\n\t\t\t\t\t\t\"name\": \"formText_1\",\n\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\"id\": 3\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_2\": {\n\t\t\t\t\t\t\"name\": \"formText_2\",\n\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\"id\": 4\n\t\t\t\t\t},\n\t\t\t\t\t\"formText_3\": {\n\t\t\t\t\t\t\"name\": \"formText_3\",\n\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\"id\": 5\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "type": "JSON" } ] @@ -2221,6 +2395,15 @@ "type": "CSharp" } ], + "success": { + "examples": [ + { + "title": "Success-Response:", + "content": " HTTP/1.1 200 OK\n{\n \"payload\": {\n \"id\": \"1\",\n \"message\": \"Successfully deleted job.\"\n }\n}", + "type": "json" + } + ] + }, "filename": "app/system/class/api/rest/v1/job/_apidoc.js", "groupTitle": "Job" }, @@ -2229,7 +2412,7 @@ "url": "/job/:id", "title": "Get Job", "name": "GetJob", - "order": "5", + "order": "2", "group": "Job", "version": "1.0.0", "description": "

Get a job.

", @@ -2244,7 +2427,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"id\": \"245\",\n \"maintenanceID\": \"0\",\n \"jobNumber\": \"245\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Test B\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"\",\n \"description\": \"\",\n \"dueDate\": \"1599688800\",\n \"assignedTo\": \"0\",\n \"priority\": \"0\",\n \"status\": \"1\",\n \"duration\": \"136800\",\n \"statusLabel\": \"Created\"\n }\n}", + "content": "{\n \"payload\": {\n \"id\": \"245\",\n \"maintenanceID\": \"0\",\n \"clientID\": \"8\",\n \"contactID\": \"12\",\n \"billingName\": \"Test client\",\n \"contactName\": \"John Doe\",\n \"jobNumber\": \"245\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Test B\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"\",\n \"description\": \"\",\n \"dueDate\": \"1599688800\",\n \"assignedTo\": \"0\",\n \"priority\": \"0\",\n \"status\": \"1\",\n \"duration\": \"136800\",\n \"statusLabel\": \"Created\",\n \"history\": {},\n \"notes\": {}\n }\n}", "type": "JSON" } ] @@ -2270,7 +2453,7 @@ "examples": [ { "title": "Success-Response:", - "content": "HTTP/1.1 200 OK\n{\n \"payload\": [{\n \"text\": \"Created Job.\",\n \"startDate\": \"2021-04-28T15:57:46+10:00\",\n \"endDate\": \"2021-04-28T15:57:46+10:00\",\n }]\n}", + "content": "HTTP/1.1 200 OK\n{\n \"payload\": [\n {\n \"type\": \"1\",\n \"text\": \"Edited Job.\",\n \"startDate\": \"2022-01-18T10:07:09+11:00\",\n \"endDate\": \"2022-01-18T10:07:09+11:00\",\n \"fields\": {\n \"dueDate\": 1642456800,\n \"duration\": 5400,\n \"endDate\": 1642462200\n },\n \"lat\": \"\",\n \"lng\": \"\"\n },\n {\n \"type\": \"1\",\n \"text\": \"Edited Job.\",\n \"startDate\": \"2022-01-17T22:31:15+11:00\",\n \"endDate\": \"2022-01-17T22:31:15+11:00\",\n \"fields\": [],\n \"lat\": \"\",\n \"lng\": \"\"\n },\n ...\n ]\n}", "type": "json" } ] @@ -2284,10 +2467,110 @@ "url": "/job/", "title": "List Jobs", "name": "ListJob", - "order": "1", + "order": "0", "group": "Job", "version": "1.0.0", - "description": "

Get a list of jobs.

", + "description": "

Get a list of jobs, lists 500 at a time. Only lists unfinished jobs by default.

", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "boolean", + "optional": true, + "field": "finished", + "description": "

List finished jobs if set (lists unfinished jobs by default).

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "from", + "description": "

List jobs with a Due Date starting from the specified date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "to", + "description": "

List jobs with a Due Date ending before the specified date.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "page", + "description": "

The page number, starting from 1.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "limit", + "description": "

The number of rows returned. Default is 500.

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "value", + "description": "

Search for invoices that contain the specified search value. Fields included in search are billingName, contactName, deliveryContact, deliveryLocation, description, invoiceNumber, jobNumber, location, orderNumber, pickupSiteName, siteName, title

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"ASC\"", + "\"DESC\"" + ], + "optional": true, + "field": "order", + "defaultValue": "DESC", + "description": "

Sort the results by Job ID (defaults to most recent first).

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "ordernumber", + "description": "

List jobs for the specified Order Number.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "jobnumber", + "description": "

List jobs for the specified Job Number.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"2\"", + "\"1,2,3\"" + ], + "optional": true, + "field": "status", + "description": "

List jobs matching the specified status. Valid status values (comma-delimited):

" + }, + { + "group": "Optional", + "type": "string", + "optional": true, + "field": "agentName", + "description": "

List jobs assigned to the specified username.

" + } + ] + } + }, "examples": [ { "title": "CURL Example", @@ -2299,7 +2582,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n \"payload\": {\n \"5555\": {\n \"id\": \"5555\",\n \"maintenanceID\": \"0\",\n \"jobNumber\": \"\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Person A\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"123 Street\",\n \"description\": \"\",\n \"dueDate\": \"1417139760\",\n \"assignedTo\": \"2251\",\n \"priority\": \"0\",\n \"status\": \"4\",\n \"duration\": \"3600\",\n \"statusLabel\": \"Completed\"\n }\n }\n}", + "content": "{\n \"payload\": {\n \"5555\": {\n \"id\": \"5555\",\n \"maintenanceID\": \"0\",\n \"clientID\": \"7\",\n \"contactID\": \"7\",\n \"billingName\": \"Fred Flint\",\n \"contactName\": \"Fred Flint\",\n \"jobNumber\": \"\",\n \"orderNumber\": \"\",\n \"invoiceID\": \"0\",\n \"invoiceNumber\": \"\",\n \"title\": \"Person A\",\n \"forms\": {\n \"2932\": {\n \"id\": \"2932\",\n \"title\": \"Features Test\"\n }\n },\n \"location\": \"123 Street\",\n \"description\": \"\",\n \"dueDate\": \"1417139760\",\n \"assignedTo\": \"2251\",\n \"priority\": \"0\",\n \"status\": \"4\",\n \"duration\": \"3600\",\n \"statusLabel\": \"Completed\"\n }\n }\n}", "type": "JSON" } ] @@ -2320,35 +2603,35 @@ "Body": [ { "group": "Body", - "type": "String", + "type": "string", "optional": false, "field": "title", "description": "

The Job Title.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "jobNumber", "description": "

The Job Number.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "orderNumber", "description": "

The Order Number of the job

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "dueDate", "description": "

The date represented in unix timestamp (no-milliseconds)

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "duration", "defaultValue": "60", @@ -2356,28 +2639,28 @@ }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "notes", "description": "

Any notes attached to this job, to be viewed by the Technician.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "location", "description": "

Location this job is at.

" }, { "group": "Body", - "type": "String", - "optional": false, + "type": "string", + "optional": true, "field": "agent", - "description": "

The user agent this job will be assigned to. Can either be the User ID or UserNane.

" + "description": "

The user agent this job will be assigned to. Can either be the User ID or Username.

" }, { "group": "Body", - "type": "Boolean", + "type": "boolean", "optional": true, "field": "sendNotification", "defaultValue": "true", @@ -2385,13 +2668,13 @@ }, { "group": "Body", - "type": "String", + "type": "string", "allowedValues": [ - "Low", - "Normal", - "Medium", - "High", - "Urgent" + "\"Low\"", + "\"Normal\"", + "\"Medium\"", + "\"High\"", + "\"Urgent\"" ], "optional": true, "field": "priority", @@ -2399,14 +2682,14 @@ }, { "group": "Body", - "type": "Number[]", + "type": "number[]", "optional": true, "field": "form", "description": "

The form IDs attached to this job.

" }, { "group": "Body", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "formData", "description": "

The content of the form.

" @@ -2415,42 +2698,42 @@ "Delivery Fields": [ { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryLocation", "description": "

If this is a delivery job, where is the drop-off location.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "siteName", "description": "

The delivery location site name.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryContact", "description": "

The contact person to be delivered to.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryPhone", "description": "

The contact's phone number.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryNotes", "description": "

Any notes specific to the delivery.

" }, { "group": "Delivery Fields", - "type": "Number", + "type": "number", "optional": true, "field": "deliveryDate", "description": "

Unixtimestamp(no-ms) of the delivery date/time.

" @@ -2459,168 +2742,168 @@ "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -2630,7 +2913,7 @@ "examples": [ { "title": "Request Body Example:", - "content": "{\n\t\"id\": 0,\n\t\"title\": \"Job Title\",\n\t\"agent\": \"YourUser\",\n\t\"location\": \"123 Fake St, Suburb, Country\",\n\t\"client\": {\n\t\t\"id\": 0,\n\t\t\"billingName\": \"Test client\",\n\t\t\"contact\": [{\n\t\t\t\"firstName\": \"John\",\n\t\t\t\"lastName\": \"Doe\",\n\t\t\t\"email\": \"john@site.com\",\n\t\t\t\"mobile\": \"0000 000 000\",\n\t\t\t\"mobileAreaCode\": \"+61\",\n\t\t\t\"custom\": {\n\t\t\t\t\"Instagram\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t\t\"Facebook\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t}\n\t\t}, \n\t\t{ ... }],\n\t\t\"location\": [{\n\t\t\t\"street1\": \"123 Fake St\",\n\t\t\t\"street2\": \"\",\n\t\t\t\"city\": \"Some city\",\n\t\t\t\"state\": \"Some state\",\n\t\t\t\"postcode\": \"Some postcode\",\n\t\t\t\"country\": \"Some country\"\n\t\t}, \n\t\t{ ... }]\n\t},\n\t\"formData\": {\n\t\t444: {\n\t\t\t\"formText\": \"Test\"\n\t\t\t\"formMultiple\": [ \"Answer1\", \"Answer2\", \"Answer3\" ],\n\t\t\t\"aRepeatedText\": [\"Value1\", \"Value2\", \"Value3\"],\n\t\t\t\"formTextInARepeatableTableRow\": { \"0_1\": \"Test1\", \"0_2\": \"Test2\" ,\"1_1\": \"Test3\", \"1_2\": \"Test4\" }\n\t\t}\n\t}\n}", + "content": " {\n \"title\": \"Job Title\",\n \"agent\": \"YourUser\",\n \"location\": \"123 Fake St, Suburb, Country\",\n \"client\": {\n \"id\": 0,\n \"billingName\": \"Test client\",\n \"contact\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john@site.com\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"custom\": {\n \"Instagram\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n },\n \"Facebook\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n }\n }\n },\n ...\n ],\n \"location\": [\n {\n \"street1\": \"123 Fake St\",\n \"street2\": \"\",\n \"city\": \"Some city\",\n \"state\": \"Some state\",\n \"postcode\": \"Some postcode\",\n \"country\": \"Some country\"\n },\n ...\n ]\n },\n \"formData\": {\n \"444\": {\n \"formText\": \"Test\",\n \"formMultiple\": [\n \"Answer1\",\n \"Answer2\",\n \"Answer3\"\n ],\n \"aRepeatedText\": [\n \"Value1\",\n \"Value2\",\n \"Value3\"\n ],\n \"formTextInARepeatableTableRow\": {\n \"0_1\": \"Test1\",\n \"0_2\": \"Test2\",\n \"1_1\": \"Test3\",\n \"1_2\": \"Test4\"\n }\n }\n }\n}", "type": "json" }, { @@ -2645,21 +2928,21 @@ "Success 200": [ { "group": "Success 200", - "type": "Object", + "type": "object", "optional": false, "field": "payload", "description": "

Payload object.

" }, { "group": "Success 200", - "type": "Number", + "type": "number", "optional": false, "field": "payload.jobID", "description": "

ID of the new created/updaetd job.

" }, { "group": "Success 200", - "type": "Number", + "type": "number", "optional": false, "field": "payload.agentID", "description": "

ID of the agent assigned to the job.

" @@ -2669,7 +2952,7 @@ "examples": [ { "title": "Success-Response:", - "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 7,\n \"agentID\": 1,\n }\n}", + "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 7,\n \"agentID\": 1\n }\n}", "type": "json" } ] @@ -2682,7 +2965,7 @@ "url": "/job/", "title": "Add Job", "name": "PostJob", - "order": "3", + "order": "1", "version": "1.0.0", "group": "Job", "parameter": { @@ -2690,35 +2973,35 @@ "Body": [ { "group": "Body", - "type": "String", + "type": "string", "optional": false, "field": "title", "description": "

The Job Title.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "jobNumber", "description": "

The Job Number.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "orderNumber", "description": "

The Order Number of the job

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "dueDate", "description": "

The date represented in unix timestamp (no-milliseconds)

" }, { "group": "Body", - "type": "Number", + "type": "number", "optional": true, "field": "duration", "defaultValue": "60", @@ -2726,28 +3009,28 @@ }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "notes", "description": "

Any notes attached to this job, to be viewed by the Technician.

" }, { "group": "Body", - "type": "String", + "type": "string", "optional": true, "field": "location", "description": "

Location this job is at.

" }, { "group": "Body", - "type": "String", - "optional": false, + "type": "string", + "optional": true, "field": "agent", - "description": "

The user agent this job will be assigned to. Can either be the User ID or UserNane.

" + "description": "

The user agent this job will be assigned to. Can either be the User ID or Username.

" }, { "group": "Body", - "type": "Boolean", + "type": "boolean", "optional": true, "field": "sendNotification", "defaultValue": "true", @@ -2755,13 +3038,13 @@ }, { "group": "Body", - "type": "String", + "type": "string", "allowedValues": [ - "Low", - "Normal", - "Medium", - "High", - "Urgent" + "\"Low\"", + "\"Normal\"", + "\"Medium\"", + "\"High\"", + "\"Urgent\"" ], "optional": true, "field": "priority", @@ -2769,14 +3052,14 @@ }, { "group": "Body", - "type": "Number[]", + "type": "number[]", "optional": true, "field": "form", "description": "

The form IDs attached to this job.

" }, { "group": "Body", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "formData", "description": "

The content of the form.

" @@ -2785,212 +3068,212 @@ "Delivery Fields": [ { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryLocation", "description": "

If this is a delivery job, where is the drop-off location.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "siteName", "description": "

The delivery location site name.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryContact", "description": "

The contact person to be delivered to.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryPhone", "description": "

The contact's phone number.

" }, { "group": "Delivery Fields", - "type": "String", + "type": "string", "optional": true, "field": "deliveryNotes", "description": "

Any notes specific to the delivery.

" }, { "group": "Delivery Fields", - "type": "Number", + "type": "number", "optional": true, "field": "deliveryDate", - "description": "

Unixtimestamp(no-ms) of the delivery date/time.

" + "description": "

Unix timestamp (no-ms) of the delivery date/time.

" } ], "Client Fields": [ { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": false, "field": "client", "description": "

The Client Object

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.id", "description": "

ID of the client.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": false, "field": "client.billingName", "description": "

The Billing Name of the client

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.contact", "description": "

An array of contacts

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.contact.id", "description": "

The ID of the client's contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.firstName", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.lastName", "description": "

Last name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.email", "description": "

First name of contact.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobile", "description": "

Mobile number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.mobileAreaCode", "description": "

Mobile number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhone", "description": "

Work phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.workPhoneAreaCode", "description": "

Work phone number area code.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhone", "description": "

Home phone number.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.contact.homePhoneAreaCode", "description": "

Home phone number area code.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom", "description": "

Object of custom variables.

" }, { "group": "Client Fields", - "type": "Object", + "type": "object", "optional": true, "field": "client.contact.custom.OBJECT_1", "description": "

Custom variable of a client. To set values requires an Object of {"value": "Example", "type": "String"}

" }, { "group": "Client Fields", - "type": "Object[]", + "type": "object[]", "optional": true, "field": "client.location", "description": "

An array of locations

" }, { "group": "Client Fields", - "type": "Number", + "type": "number", "optional": true, "field": "client.location.id", "description": "

The ID of the client's location.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street1", "description": "

Street 1 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.street2", "description": "

Street 2 address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.city", "description": "

City address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.state", "description": "

State address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.postcode", "description": "

Postcode address.

" }, { "group": "Client Fields", - "type": "String", + "type": "string", "optional": true, "field": "client.location.country", "description": "

Country address.

" @@ -3000,7 +3283,7 @@ "examples": [ { "title": "Request Body Example:", - "content": "{\n\t\"id\": 0,\n\t\"title\": \"Job Title\",\n\t\"agent\": \"YourUser\",\n\t\"location\": \"123 Fake St, Suburb, Country\",\n\t\"client\": {\n\t\t\"id\": 0,\n\t\t\"billingName\": \"Test client\",\n\t\t\"contact\": [{\n\t\t\t\"firstName\": \"John\",\n\t\t\t\"lastName\": \"Doe\",\n\t\t\t\"email\": \"john@site.com\",\n\t\t\t\"mobile\": \"0000 000 000\",\n\t\t\t\"mobileAreaCode\": \"+61\",\n\t\t\t\"custom\": {\n\t\t\t\t\"Instagram\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t\t\"Facebook\": {\"value\": \"@john.doe\", \"type\": \"Text\"},\n\t\t\t}\n\t\t}, \n\t\t{ ... }],\n\t\t\"location\": [{\n\t\t\t\"street1\": \"123 Fake St\",\n\t\t\t\"street2\": \"\",\n\t\t\t\"city\": \"Some city\",\n\t\t\t\"state\": \"Some state\",\n\t\t\t\"postcode\": \"Some postcode\",\n\t\t\t\"country\": \"Some country\"\n\t\t}, \n\t\t{ ... }]\n\t},\n\t\"formData\": {\n\t\t444: {\n\t\t\t\"formText\": \"Test\"\n\t\t\t\"formMultiple\": [ \"Answer1\", \"Answer2\", \"Answer3\" ],\n\t\t\t\"aRepeatedText\": [\"Value1\", \"Value2\", \"Value3\"],\n\t\t\t\"formTextInARepeatableTableRow\": { \"0_1\": \"Test1\", \"0_2\": \"Test2\" ,\"1_1\": \"Test3\", \"1_2\": \"Test4\" }\n\t\t}\n\t}\n}", + "content": "{\n \"id\": 0,\n \"title\": \"Job Title\",\n \"agent\": \"YourUser\",\n \"location\": \"123 Fake St, Suburb, Country\",\n \"client\": {\n \"id\": 0,\n \"billingName\": \"Test client\",\n \"contact\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john@site.com\",\n \"mobile\": \"0000 000 000\",\n \"mobileAreaCode\": \"+61\",\n \"custom\": {\n \"Instagram\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n },\n \"Facebook\": {\n \"value\": \"@john.doe\",\n \"type\": \"Text\"\n }\n }\n },\n ...\n ],\n \"location\": [\n {\n \"street1\": \"123 Fake St\",\n \"street2\": \"\",\n \"city\": \"Some city\",\n \"state\": \"Some state\",\n \"postcode\": \"Some postcode\",\n \"country\": \"Some country\"\n },\n ...\n ]\n },\n \"formData\": {\n \"444\": {\n \"formText\": \"Test\",\n \"formMultiple\": [\n \"Answer1\",\n \"Answer2\",\n \"Answer3\"\n ],\n \"aRepeatedText\": [\n \"Value1\",\n \"Value2\",\n \"Value3\"\n ],\n \"formTextInARepeatableTableRow\": {\n \"0_1\": \"Test1\",\n \"0_2\": \"Test2\",\n \"1_1\": \"Test3\",\n \"1_2\": \"Test4\"\n }\n }\n }\n}", "type": "json" }, { @@ -3011,35 +3294,10 @@ ] }, "success": { - "fields": { - "Success 200": [ - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "payload", - "description": "

Payload object.

" - }, - { - "group": "Success 200", - "type": "Number", - "optional": false, - "field": "payload.jobID", - "description": "

ID of the new created/updaetd job.

" - }, - { - "group": "Success 200", - "type": "Number", - "optional": false, - "field": "payload.agentID", - "description": "

ID of the agent assigned to the job.

" - } - ] - }, "examples": [ { "title": "Success-Response:", - "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 7,\n \"agentID\": 1,\n }\n}", + "content": "HTTP/1.1 200 OK\n{\n \"payload\": {\n \"jobID\": 1,\n \"jobNumber\": 1,\n \"agentID\": false,\n \"clientID\": 8,\n \"contactID\": 12\n }\n}", "type": "json" } ] @@ -3056,24 +3314,81 @@ "order": "2", "version": "1.0.0", "description": "

Returns the submitted form.

", + "parameter": { + "fields": { + "Optional": [ + { + "group": "Optional", + "type": "boolean", + "optional": true, + "field": "simple", + "description": "

Submitted form data format is simplified if true.

" + } + ] + } + }, + "examples": [ + { + "title": "CURL Example", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/form/submit/88", + "type": "json" + } + ], + "success": { + "examples": [ + { + "title": "CURL Response", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"count\": \"4\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"formDataLastSaved\": \"0\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"status\": \"Ok\",\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" + }, + { + "title": "CURL Response using Simple mode", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"formDataLastSaved\": \"0\",\n \"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": \"0.0\",\n \"longitude\": \"0.0\",\n \"location\": \"\",\n \"status\": \"Ok\",\n \"userID\": \"20150\",\n \"userName\": \"admin\",\n\t\t\"content\": {\n\t\t\t\"signed\": {\n\t\t\t\t\"0\": \"https://UrlToImage/\"\n\t\t\t},\n\t\t\t\"signedDate\": {\n\t\t\t\t\"0\": \"\"\n\t\t\t},\n\t\t\t\"totalPayable\": {\n\t\t\t\t\"0\": \"1231\"\n\t\t\t},\n\t\t\t\"Description of work\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Custom\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"formCheckbox_4\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"No Risks Identified\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"PaymentMethod\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"sendEmail\": {\n\t\t\t\t\"0\": \"dimitri@formitize.com\"\n\t\t\t},\n\t\t\t\"Treatment time\": {\n\t\t\t\t\"0\": \"1:00 AM\"\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" + } + ] + }, + "filename": "app/system/class/api/rest/v1/form/_apidoc.submit.js", + "groupTitle": "Submitted_Forms" + }, + { + "type": "get", + "url": "/form/submit/?id=n", + "title": "Get Submitted Forms by ID", + "name": "SubmittedGetIDs", + "group": "Submitted_Forms", + "order": "3", + "version": "1.0.0", + "description": "

Returns a list of submitted forms or a single form.

", "parameter": { "fields": { "Arguments": [ { "group": "Arguments", - "type": "Number", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"1,2,3\"" + ], "optional": false, "field": "id", - "description": "

The ID of the submitted form.

" + "description": "

The ID(s) of the submitted form(s) (multiples are comma delimited).

" } ], "Optional": [ { "group": "Optional", - "type": "Boolean", - "optional": false, + "type": "boolean", + "optional": true, "field": "simple", "description": "

Submitted form data format is simplified if true.

" + }, + { + "group": "Optional", + "type": "number", + "optional": true, + "field": "jobID", + "description": "

Returns the list of submitted forms attached to a Job ID.

" } ] } @@ -3081,7 +3396,7 @@ "examples": [ { "title": "CURL Example", - "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/form/submit/88", + "content": "curl -A YourCompany -u admin:password -X \"GET\" https://service.formitize.com/api/rest/v2/form/submit/?id=1,2,3", "type": "json" } ], @@ -3089,13 +3404,18 @@ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"count\": \"4\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"146\": {\n\t\t\t\"submittedFormID\": \"146\",\n\t\t\t\"jobID\": \"894\",\n\t\t\t\"formID\": \"35639\",\n\t\t\t\"userID\": \"20150\",\n\t\t\t\"userName\": \"admin\",\n\t\t\t\"count\": \"4\",\n\t\t\t\"version\": \"8\",\n\t\t\t\"title\": \"CRM Extra\",\n\t\t\t\"formDateCreated\": \"1563175490\",\n\t\t\t\"dateSubmitted\": \"1563175490\",\n\t\t\t\"dateModified\": \"1563175490\",\n\t\t\t\"formDataLastSaved\": \"0\",\n\t\t\t\"modifiedBy\": \"0\",\n\t\t\t\"latitude\": false,\n\t\t\t\"longitude\": false,\n\t\t\t\"location\": false,\n\t\t\t\"content\": {\n\t\t\t\t\"formSubheader_1\": {\n\t\t\t\t\t\"0\": {\n\t\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"status\": \"Ok\",\n\t\t\t\"attachments\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\t\"name\": \"Default\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t...\n\t}\n}", "type": "JSON" }, { - "title": "CURL Respose using Simple mode", - "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"signed\": {\n\t\t\t\t\"0\": \"https://UrlToImage/\"\n\t\t\t},\n\t\t\t\"signedDate\": {\n\t\t\t\t\"0\": \"\"\n\t\t\t},\n\t\t\t\"totalPayable\": {\n\t\t\t\t\"0\": \"1231\"\n\t\t\t},\n\t\t\t\"Description of work\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Custom\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"formCheckbox_4\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"No Risks Identified\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"PaymentMethod\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"sendEmail\": {\n\t\t\t\t\"0\": \"dimitri@formitize.com\"\n\t\t\t},\n\t\t\t\"Treatment time\": {\n\t\t\t\t\"0\": \"1:00 AM\"\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", - "type": "CURL" + "title": "CURL Response (single)", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"userID\": \"20150\",\n\t\t\"userName\": \"admin\",\n\t\t\"count\": \"4\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"formDataLastSaved\": \"0\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": false,\n\t\t\"longitude\": false,\n\t\t\"location\": false,\n\t\t\"content\": {\n\t\t\t\"formSubheader_1\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"id\": 31,\n\t\t\t\t\t\"type\": \"formSubheader\",\n\t\t\t\t\t\"name\": \"formSubheader_1\",\n\t\t\t\t\t\"children\": {\n\t\t\t\t\t\t\"signed\": {\n\t\t\t\t\t\t\t\"id\": 44,\n\t\t\t\t\t\t\t\"type\": \"formSignature\",\n\t\t\t\t\t\t\t\"name\": \"signed\",\n\t\t\t\t\t\t\t\"image\": \"https://url/\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"signedDate\": {\n\t\t\t\t\t\t\t\"id\": 45,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"signedDate\",\n\t\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"totalPayable\": {\n\t\t\t\t\t\t\t\"id\": 46,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"totalPayable\",\n\t\t\t\t\t\t\t\"value\": \"1231\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"PaymentMethod\": {\n\t\t\t\t\t\t\t\"id\": 53,\n\t\t\t\t\t\t\t\"type\": \"formMultiple\",\n\t\t\t\t\t\t\t\"name\": \"PaymentMethod\",\n\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"sendEmail\": {\n\t\t\t\t\t\t\t\"id\": 65,\n\t\t\t\t\t\t\t\"type\": \"formText\",\n\t\t\t\t\t\t\t\"name\": \"sendEmail\",\n\t\t\t\t\t\t\t\"value\": \"support@formitize.com\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"status\": \"Ok\",\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" + }, + { + "title": "CURL Response (simple)", + "content": "{\n\t\"payload\": {\n\t\t\"submittedFormID\": \"146\",\n\t\t\"jobID\": \"894\",\n\t\t\"formID\": \"35639\",\n\t\t\"version\": \"8\",\n\t\t\"title\": \"CRM Extra\",\n\t\t\"formDateCreated\": \"1563175490\",\n\t\t\"formDataLastSaved\": \"0\",\n \"dateSubmitted\": \"1563175490\",\n \"dateModified\": \"1563175490\",\n \"modifiedBy\": \"0\",\n\t\t\"latitude\": \"0.0\",\n \"longitude\": \"0.0\",\n \"location\": \"\",\n \"status\": \"Ok\",\n \"userID\": \"20150\",\n \"userName\": \"admin\",\n\t\t\"content\": {\n\t\t\t\"signed\": {\n\t\t\t\t\"0\": \"https://UrlToImage/\"\n\t\t\t},\n\t\t\t\"signedDate\": {\n\t\t\t\t\"0\": \"\"\n\t\t\t},\n\t\t\t\"totalPayable\": {\n\t\t\t\t\"0\": \"1231\"\n\t\t\t},\n\t\t\t\"Description of work\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Custom\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"formCheckbox_4\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"No Risks Identified\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"PaymentMethod\": {\n\t\t\t\t\"0\": {\n\t\t\t\t\t\"0\": \"Cash\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"sendEmail\": {\n\t\t\t\t\"0\": \"dimitri@formitize.com\"\n\t\t\t},\n\t\t\t\"Treatment time\": {\n\t\t\t\t\"0\": \"1:00 AM\"\n\t\t\t}\n\t\t},\n\t\t\"attachments\": {\n\t\t\t\"0\": {\n\t\t\t\t\"url\": \"https://UrlToDocument\",\n\t\t\t\t\"type\": \"pdf\",\n\t\t\t\t\"name\": \"Default\"\n\t\t\t}\n\t\t}\n\t}\n}", + "type": "JSON" } ] }, @@ -3116,24 +3436,46 @@ "Optional": [ { "group": "Optional", - "type": "String", - "optional": false, + "type": "string", + "optional": true, "field": "title", "description": "

Searches submitted forms for the title.

" }, { "group": "Optional", - "type": "Number", - "optional": false, + "type": "number", + "optional": true, "field": "page", "description": "

Returns the results for x page. Defaults to 1.

" }, { "group": "Optional", - "type": "Number", - "optional": false, + "type": "number", + "optional": true, "field": "jobID", "description": "

Returns the list of submitted forms attached to a Job ID.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"YYYY-MM-DD\"", + "\"Unix_timestamp\"" + ], + "optional": true, + "field": "modifiedAfterDate", + "description": "

List submitted forms modified on or after the specified date.

" + }, + { + "group": "Optional", + "type": "string", + "allowedValues": [ + "\"1\"", + "\"1,2,3\"" + ], + "optional": true, + "field": "formID", + "description": "

List submitted forms from the matching Form ID(s) (multiples are comma-delimited).

" } ] } @@ -3149,7 +3491,7 @@ "examples": [ { "title": "CURL Response", - "content": "{\n\t\"payload\": {\n\t\t\"3\": {\n\t\t\t\"submittedFormID\": 3,\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 1,\n\t\t\t\"dateCreated\": 1543276384,\n\t\t\t\"dateModified\": 1554265832\n\t\t},\n\t\t\"4\": {\n\t\t\t\"submittedFormID\": 4,\n\t\t\t\"title\": \"New Job - Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 3,\n\t\t\t\"dateCreated\": 1543537388,\n\t\t\t\"dateModified\": 1546819983\n\t\t}\n}", + "content": "{\n\t\"payload\": {\n\t\t\"3\": {\n\t\t\t\"submittedFormID\": 3,\n\t\t\t\"status\": \"Ok\",\n\t\t\t\"title\": \"Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 1,\n\t\t\t\"dateCreated\": 1543276384,\n\t\t\t\"dateModified\": 1554265832,\n\t\t\t\"latitude\": \"\",\n \"formDataLastSaved\": 0,\n \"dateSubmitted\": 1543276384,\n \"longitude\": \"\",\n \"version\": 2,\n \"count\": \"2\",\n \"location\": \"\",\n \"userName\": \"\"\n\t\t},\n\t\t\"4\": {\n\t\t\t\"submittedFormID\": 4,\n\t\t\t\"status\": \"Ok\",\n\t\t\t\"title\": \"New Job - Assets\",\n\t\t\t\"formID\": 1,\n\t\t\t\"userID\": 20150,\n\t\t\t\"jobID\": 3,\n\t\t\t\"dateCreated\": 1543537388,\n\t\t\t\"dateModified\": 1546819983,\n\t\t\t\"latitude\": \"\",\n \"formDataLastSaved\": 0,\n \"dateSubmitted\": 1543537388,\n \"longitude\": \"\",\n \"version\": 2,\n \"count\": \"2\",\n \"location\": \"\",\n \"userName\": \"\"\n\t\t}\n}", "type": "JSON" } ] diff --git a/docs/api_project.js b/docs/api_project.js index d1789fa..ff14cc8 100644 --- a/docs/api_project.js +++ b/docs/api_project.js @@ -4,7 +4,7 @@ define({ "description": "The API for Formitize.", "header": { "title": "SDKs", - "content": "

Available SDKs

\n\n" + "content": "

Available SDKs

\n\n

Tools

\n\n



\n" }, "title": "Formitize API", "url": "https://service.formitize.com/api/rest/v2", @@ -16,7 +16,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-08-17T06:55:39.577Z", + "time": "2023-08-30T03:20:28.802Z", "url": "https://apidocjs.com", "version": "0.29.0" } diff --git a/docs/api_project.json b/docs/api_project.json index c5b708c..c0576f7 100644 --- a/docs/api_project.json +++ b/docs/api_project.json @@ -4,7 +4,7 @@ "description": "The API for Formitize.", "header": { "title": "SDKs", - "content": "

Available SDKs

\n\n" + "content": "

Available SDKs

\n\n

Tools

\n\n



\n" }, "title": "Formitize API", "url": "https://service.formitize.com/api/rest/v2", @@ -16,7 +16,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-08-17T06:55:39.577Z", + "time": "2023-08-30T03:20:28.802Z", "url": "https://apidocjs.com", "version": "0.29.0" }