Types

This endpoint is currently in development and not considered production-quality at this time.

Channel Ids used in the endpoint are need to reference the Channel Object's "public_id" instead of the channel "i

Get All Types

Get information about all of you team's types.

GET /task_types

Pagination

The maximum number of types that will be returned in a single request is 100. If there are more than 100 types you can specify a page parameter great than 1 to get more data. The response will contain information about how many pages of data are available.

Query Parameters

Parameter

Default

Description

page

1

Specifies which page of results to return

per_page

100

Specifies maximum number of types to return in a given request. The maximum you can specify is 100.

Success Response

A successful response will have an HTTP status of 200

Response Properties

Property

Description

page

Current page number of data returned

per_page

Maximum number of types returned per page

total_pages

Number of pages of data available

response_count

The number of types that were returned from the given request

total_count

Total number of types that are available

task_types

Collection of task_types

Example response

The sample response below indicates that you have received the second page of results. There are 2 pages available. The current page contains 21 of the total 121 types.

{
    "page": 2,
    "per_page": 100,
    "total_pages": 2,
    "response_count": 21,
    "total_count": 121,
    "task_types": [
      {...},
      {...}
    ]
}

Create Type

Create a new type.

POST /task_types

report_form_type options: "INCIDENT_REQUEST", "PERIOD_REPORT"

Example Period Report Type Request Body

{
  "task_type": {
    "name": "My Task Type",
    "report_form_type": "PERIOD_REPORT"
  },
  "feedback_page_settings": {
    "report_form_type": "PERIOD_REPORT",
    "page_header": "",
    "stylesheet": "",
    "bg_color": "FFFFFF",
    "show_form": true,
    "show_sms_link": false,
    "logo_image_url": "",
    "redirect_url": "",
    "success_message": "",
    "form_label": "",
    "sms_button_label": "",
    "nps_text": "",
    "request_nps": "none",
    "request_name": false,
    "contact_header_text": "Contact Information (optional)",
    "request_mobile_phone": false,
    "request_email": false,
    "auto_task_create": false,
    "multilingual": false,
    "hasMobilityFormSettings": false
  },
  "issue_or_request_fields": {
    "channel": "chat.team.6ae364e5-f8a1-4267-9759-db3d9231a426",
    "fields": {
      "0": {
        "name": "Description1",
        "type": "text"
      },
      "1": {
        "name": "Rich Descriotion",
        "type": "rich-text"
      },
      "2": {
        "name": "Some Number",
        "type": "number"
      },
      "3": {
        "name": "Some Date",
        "type": "date"
      },
      "4": {
        "name": "Phone Number",
        "type": "mobile"
      },
      "5": {
        "name": "Boolean?",
        "type": "toggle"
      },
      "6": {
        "name": "Selected from Options",
        "type": "selection",
        "options": [
          {
            "id": "432e83fb-16b8-4b61-a6d2-0cb9b273d4f8",
            "value": "Option A"
          },
          {
            "id": "b60d3005-f513-4917-a07a-a8bf7312eaa9",
            "value": "Option B"
          }
        ],
        "selections": [
          "Option 1",
          "Options 2"
        ]
      },
      "7": {
        "name": "Some Locations",
        "type": "location"
      },
      "8": {
        "name": "AAAAAA",
        "type": "text",
        "additional": {
          "formFieldSize": 20
        }
      },
      "9": {
        "name": "Employees",
        "type": "subform",
        "fields": {
          "0": {
            "name": "Name",
            "type": "text",
            "additional": {
              "formFieldSize": 20
            }
          },
          "1": {
            "name": "Position",
            "type": "selection",
            "options": [
              {
                "id": "907b4e29-6979-4f39-ac23-254b3572c95c",
                "value": "Supervisor"
              },
              {
                "id": "038896d6-3dd5-45c3-aef5-84edd4b761b3",
                "value": "Crew"
              }
            ]
          }
        }
      }
    }
  },
  "additional_types": []
}

Example Incident Request Request Body (with "additional_types")

{
  "task_type": {
    "name": "IR Type",
    "report_form_type": "INCIDENT_REQUEST"
  },
  "feedback_page_settings": {
    "report_form_type": "INCIDENT_REQUEST",
    "page_header": "",
    "stylesheet": "",
    "bg_color": "FFFFFF",
    "show_form": true,
    "show_sms_link": false,
    "logo_image_url": "",
    "redirect_url": "",
    "success_message": "",
    "form_label": "",
    "sms_button_label": "",
    "nps_text": "",
    "request_nps": "none",
    "request_name": false,
    "contact_header_text": "Contact Information (optional)",
    "request_mobile_phone": false,
    "request_email": false,
    "auto_task_create": false,
    "multilingual": false,
    "hasMobilityFormSettings": false
  },
  "issue_or_request_fields": {
    "channel": "chat.team.711528a4-713b-4521-ac88-49f42771da9b",
    "fields": {
      "0": {
        "name": "Description",
        "type": "text"
      },
      "1": {
        "name": "Urgent",
        "type": "toggle"
      }
    }
  },
  "additional_types": [
    {
      "id": 1001833975
    }
  ]
}

Success Response

A successful type creation response will have an HTTP status of 201 created. The payload of the response will contain information about the type.

Error Response

If there was a problem creating the type you will receive a response that contains status and message properties.

Example error response:

{
    "status": 422,
    "message": "Validation failed: Name has already been taken"
}

Get Specified Type

Get information about a specific type

GET /task_types/{task_type_id}

Path Parameters

Parameter

Description

task_type_id

Id of the type you are requesting information about

Success Response

A successful get response will have an HTTP status of 200

Response Properties

TBD

Example Response Body

{
    "task_type": {
        "id": 1001834056,
        "name": "Big Ol' Form1",
        "team_id": "08697d4a-dd01-457f-a4f7-823f0ab35814",
        "created_at": "2023-05-01T18:45:20.111Z",
        "sequential_id": 18,
        "can_edit": true,
        "issue_or_request_fields": {
            "fields": {
                "0": {
                    "name": "Description1",
                    "type": "text"
                },
                "1": {
                    "name": "Rich Descriotion",
                    "type": "rich-text"
                },
                "2": {
                    "name": "Some Number",
                    "type": "number"
                },
                "3": {
                    "name": "Some Date",
                    "type": "date"
                },
                "4": {
                    "name": "Phone Number",
                    "type": "mobile"
                },
                "5": {
                    "name": "Boolean?",
                    "type": "toggle"
                },
                "6": {
                    "name": "Selected from Options",
                    "type": "selection",
                    "options": [
                        {
                            "id": "432e83fb-16b8-4b61-a6d2-0cb9b273d4f8",
                            "value": "Option A"
                        },
                        {
                            "id": "b60d3005-f513-4917-a07a-a8bf7312eaa9",
                            "value": "Option B"
                        }
                    ],
                    "selections": [
                        "Option 1",
                        "Options 2"
                    ]
                },
                "7": {
                    "name": "Some Locations",
                    "type": "location"
                },
                "8": {
                    "name": "AAAAAA",
                    "type": "text",
                    "additional": {
                        "formFieldSize": 20
                    }
                },
                "9": {
                    "name": "Employees",
                    "type": "subform",
                    "fields": {
                        "0": {
                            "name": "Name",
                            "type": "text",
                            "additional": {
                                "formFieldSize": 20
                            }
                        },
                        "1": {
                            "name": "Position",
                            "type": "selection",
                            "options": [
                                {
                                    "id": "907b4e29-6979-4f39-ac23-254b3572c95c",
                                    "value": "Supervisor"
                                },
                                {
                                    "id": "038896d6-3dd5-45c3-aef5-84edd4b761b3",
                                    "value": "Crew"
                                }
                            ]
                        }
                    }
                }
            },
            "channel": "chat.team.6ae364e5-f8a1-4267-9759-db3d9231a426"
        },
        "mobility_form_settings": {
            "mobility_mobile_phone_required": false,
            "mobility_first_name_required": true,
            "mobility_last_name_required": false,
            "mobility_pickup_location_required": true,
            "mobility_pickup_details_required": false,
            "mobility_dropoff_location_required": true,
            "mobility_dropoff_details_required": false,
            "mobility_how_many_required": true,
            "mobility_notes_required": false
        },
        "report_form_type": "PERIOD_REPORT",
        "additional_types": [],
        "encoded_type_token": "MDg2OTdkNGEtZGQwMS00NTdmLWE0ZjctODIzZjBhYjM1ODE0fDEwMDE4MzQwNTY=",
        "qr_settings": {}
    }
}

Update Type

Update a specified type.

POST /task_types/{task_type_id}

Path Parameters

Parameter

Description

task_type_id

Id of the type you are updating

Body Parameters

See Create Type Parameters

Success Response

A successful group update response will have an HTTP status of 200. The payload of the response will contains information about the type

Delete Type

Delete a specified type.

DELETE /task_types/{task_type_id}

Path Parameters

Parameter

Description

task_type_id

Id of the type you are deleting

Success Response

A successful type delete will have an HTTP status of 200. The body of the response will also contain information about the type that was deleted.

Last updated

Logo

© Copyright 2024 ALO.ai, Inc. • All Rights Reserved