{
  "swagger": "2.0",
  "info": {
    "version": "1.0",
    "title": "Microsoft Kaizala",
    "description": "Microsoft Kaizala is a mobile app that helps you connect with your entire mobile workforce and supply chain, organize and allocate tasks more efficiently with built-in and custom Actions, and get actionable information and insights to accelerate decision-making."
  },
  "x-ms-api-annotation": {
    "license": {
      "status": "Preview"
    }
  },
  "host": "api.kaiza.la",
  "basePath": "/v1",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "tags": [
    {
      "name": "Authentication APIs",
      "description": "These APIs help in gaining access for 3rd party systems to interact with Kaizala API platform. Kaizala implements custom token based authorization mechanism. This mechanism uses the concept of Refresh and Access Tokens to manage access authorization for the Kaizala Platform APIs. /n"
    },
    {
      "name": "Group Management APIs",
      "description": "These APIs allow group admin(s) to access group resources and manage group memberships accordingly. <br />"
    },
    {
      "name": "Content Creation APIs",
      "description": "API end-point to send instances of Kaizala Actions to conversation groups inside Kaizala. <br /> Current scope is to support following action types: <Table>  <tr><th> Action </th> <th>POST Supported </th><th> Id </th></tr> <tr><td> Picture Attachment </td> <td> Yes </td> <td>  image  </td></tr> <tr><td> Audio Attachment </td> <td> Yes </td> <td>  audio  </td></tr> <tr><td> Document Attachment </td> <td> Yes </td>  <td>  document  </td></tr> <tr><td> Contact Attachment </td> <td> No </td> <td>  N/A  </td></tr> <tr><td> Job </td> <td> Yes </td>  <td>  Job  </td></tr> <tr><td> Survey </td> <td> Yes </td> <td>  survey  </td></tr> <tr><td> Photo with Location </td> <td> No </td> <td>  photoWithLocation  </td></tr> <tr><td> Let's Meet </td> <td> Yes </td> <td>  LetsMeet  </td></tr> <tr><td> Quick Poll </td> <td> Yes </td> <td>  Poll  </td></tr> <tr><td> Share Location </td> <td> No </td> <td>  shareLocation  </td></tr> <tr><td> Request Location </td> <td> No </td> <td>  N/A  </td></tr> <tr><td> Live Location </td> <td> No </td> <td>  N/A  </td></tr> <tr><td> Announcement </td> <td> Yes </td> <td>  Announcement  </td></tr> </Table> "
    },
    {
      "name": "Content Query APIs",
      "description": "These set of APIs retrieve the list of action instances sent to a group <Table>  <tr><th> Action </th> <th>GET Supported </th><th> Id </th></tr> <tr><td> Picture Attachment </td> <td> Yes </td> <td>  image  </td></tr> <tr><td> Audio Attachment </td> <td> No </td> <td>  audio  </td></tr> <tr><td> Document Attachment </td> <td> Yes </td>  <td>  document  </td></tr> <tr><td> Contact Attachment </td> <td> No </td> <td>  N/A  </td></tr> <tr><td> Job </td> <td> Yes </td>  <td>  Job  </td></tr> <tr><td> Survey </td> <td> Yes </td> <td>  survey  </td></tr> <tr><td> Photo with Location </td> <td> Yes </td> <td>  photoWithLocation  </td></tr> <tr><td> Let's Meet </td> <td> Yes </td> <td>  LetsMeet  </td></tr> <tr><td> Quick Poll </td> <td> Yes </td> <td>  Poll  </td></tr> <tr><td> Share Location </td> <td> Yes </td> <td>  shareLocation  </td></tr> <tr><td> Request Location </td> <td> No </td> <td>  N/A  </td></tr> <tr><td> Live Location </td> <td> No </td> <td>  N/A  </td></tr> <tr><td> Announcement </td> <td> No </td> <td>  Announcement  </td></tr> </Table>   "
    },
    {
      "name": "Subscription Webhooks",
      "description": "Microsoft Kaizala API also provides a way for developers to register for specific events within the Kaizala platform via WebHooks. <br />  WebHooks is a lightweight HTTP pattern providing a simple publisher/subscriber model for wiring together Web APIs and SaaS services. When an event happens in Kaizala, a notification is sent in the form of an HTTP POST request to registered subscribers. The POST request contains information about the event which makes it possible for the receiver to act accordingly. <br /> <br />  Using WebHooks, you can subscribe to various events that occur within a conversation group context in Kaizala."
    }
  ],
  "paths": {
    "/generatePin": {
      "post": {
        "description": "This API generates One-time PIN for a mobile number, when Application/Connector Id is provided.",
        "summary": "Generate One-Time PIN",
        "tags": [
          "Authentication APIs"
        ],
        "operationId": "GeneratePin",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "title": "Generate Pin Request",
              "x-ms-example": {
                "mobileNumber": "{{mobile-number}}",
                "applicationId": "{{application-id}}"
              },
              "type": "object",
              "properties": {
                "mobileNumber": {
                  "description": "Mobile Number for which PIN would be generated",
                  "type": "string"
                },
                "applicationId": {
                  "description": "ID associated with the Connector",
                  "type": "string"
                }
              },
              "required": [
                "mobileNumber",
                "applicationId"
              ]
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object"
            },
            "x-ms-example": {
              "text/plain": "{}"
            }
          }
        },
        "security": [],
        "x-unitTests": [
          {
            "request": {
              "method": "POST",
              "uri": "/generatePin",
              "headers": {
                "Content-Type": "application/json"
              },
              "body": "{\"mobileNumber\":\"{{mobile-number}}\", applicationId:\"{{application-id}}\"}"
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "KEYS",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {
                "access-control-allow-origin": "*",
                "content-length": "2",
                "content-type": "application/json; charset=utf-8",
                "date": "Fri, 15 Sep 2017 11:31:25 GMT",
                "server": "Microsoft-IIS/10.0",
                "status": "200",
                "x-powered-by": "ASP.NET"
              },
              "body": "{}"
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "Step1 - Generate Pin",
            "x-testDescription": "Api to trigger Kaizala otp"
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/loginWithPinAndApplicationId": {
      "post": {
        "description": "This API generates refresh token for the given Application/Connector Id, when pin, mobile number & Application/Connector Id is provided.",
        "summary": "Login with pin and applicationId to get refresh token",
        "tags": [
          "Authentication APIs"
        ],
        "operationId": "GetRefreshToken",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Refresh Token"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "$ref": "#/definitions/Response - Refresh Token"
            },
            "x-ms-example": {
              "application/json": {
                "refreshToken": "adwawaw",
                "grantedScope": "groupinfo.read,groupinfo.write,groupinfo.remove,groupinfo.update,groupmember.read,groupmember.write,groupmember.remove,textmessage.read,action.read,action.write,action.update,profile.write,media.read,webhook.read,webhook.write,webhook.remove,webhook.update",
                "refreshTokenExpiry": 1537016388242
              }
            }
          }
        },
        "security": [],
        "x-unitTests": [
          {
            "request": {
              "method": "POST",
              "uri": "/loginWithPinAndApplicationId",
              "headers": {
                "Content-Type": "application/json"
              },
              "body": "{\"mobileNumber\":\"{{mobile-number}}\",\"applicationId\":\"{{application-id}}\", \"pin\":8876}"
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "RAW",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {
                "access-control-allow-origin": "*",
                "content-length": "1144",
                "content-type": "application/json; charset=utf-8",
                "date": "Fri, 15 Sep 2017 12:59:47 GMT",
                "server": "Microsoft-IIS/10.0",
                "status": "200",
                "x-powered-by": "ASP.NET"
              },
              "body": "{\n    \"refreshToken\": \"adwawaw\",\n    \"grantedScope\": \"groupinfo.read,groupinfo.write,groupinfo.remove,groupinfo.update,groupmember.read,groupmember.write,groupmember.remove,textmessage.read,action.read,action.write,action.update,profile.write,media.read,webhook.read,webhook.write,webhook.remove,webhook.update\",\n    \"refreshTokenExpiry\": 1537016388242\n}"
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "Step2 - Login with pin and applicationId to get refreshToken",
            "x-testDescription": "Login with pin and applicationId to get refreshToken"
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/accessToken": {
      "get": {
        "description": "This API generates Access token to access Kaizala resources, when refresh token, Application/Connector Id and Application/Connector Secret is provided",
        "summary": "Retrieve the access token",
        "tags": [
          "Authentication APIs"
        ],
        "operationId": "GenerateAccessToken",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "applicationId",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "ID associated with the Connector"
          },
          {
            "name": "applicationSecret",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Secret associated with the Connector"
          },
          {
            "name": "refreshToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "refreshToken shared by the Kaizala Group Admin when the respective Connector was granted access to the group"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "$ref": "#/definitions/Response - Access Token"
            },
            "x-ms-example": {
              "application/json": {
                "accessToken": "asdasadadaad",
                "endpointUrl": "https://inc-000.KaizalaMessaging.osi.office.net",
                "accessTokenExpiry": 1505566877207,
                "scope": "token.write"
              }
            }
          }
        },
        "security": [],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/accessToken",
              "headers": {
                "applicationId": "{{application-id}}",
                "applicationSecret": "{{application-secret}}",
                "refreshToken": "{{refresh-token}}"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "RAW",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {
                "content-length": "993",
                "content-type": "application/json; charset=utf-8",
                "date": "Fri, 15 Sep 2017 13:01:16 GMT",
                "server": "Microsoft-IIS/10.0",
                "status": "200",
                "x-powered-by": "ASP.NET"
              },
              "body": "{\n    \"accessToken\": \"asdasadadaad\",\n    \"endpointUrl\": \"https://inc-000.KaizalaMessaging.osi.office.net\",\n    \"accessTokenExpiry\": 1505566877207,\n    \"scope\": \"token.write\"\n}"
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "Step3 - Retrieve the access token",
            "x-testDescription": "Generate access token from refresh token, applicationId and applicationSecret"
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups": {
      "post": {
        "description": "This API allows creation of a a group, including Managed Public Groups. It takes array of string as input. Each string is mobile number(with country code). This API can take maximum of 100 mobile numbers as input.\n\tGroupType: Group/ConnectGroup. ConnectGroup for Managed public group.",
        "summary": "Create a group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "CreateGroup",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Create a managed public group"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point "
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "$ref": "#/definitions/Response - Create a group"
            },
            "x-ms-example": {
              "application/json": {
                "groupId": "5fe5b80a-52d1-4d8a-8086-cf8f34259de2",
                "groupName": "Kaizala Test group",
                "membersAdded": true
              }
            }
          }
        },
        "security": [],
        "x-ms-example": [
          {
            "request": {
              "method": "POST",
              "uri": "/groups",
              "headers": {
                "Content-Type": "application/json",
                "accessToken": "{{access-token}}"
              },
              "body": "{name:\"Kaizala Test group\", welcomeMessage:\"Welcome to group created programmatically via Postman\", members:[\"{{mobile-number-2}}\"], groupType:\"Group\"}"
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "RAW",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {
                "access-control-allow-origin": "*",
                "content-length": "103",
                "content-type": "application/json; charset=utf-8",
                "date": "Thu, 14 Sep 2017 10:57:24 GMT",
                "server": "Microsoft-IIS/10.0",
                "status": "200",
                "x-powered-by": "ASP.NET"
              },
              "body": "{\"groupId\":\"5fe5b80a-52d1-4d8a-8086-cf8f34259de2\",\"groupName\":\"Kaizala Test group\",\"membersAdded\":true}"
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "Step1 - Create a group",
            "x-testDescription": "API to create a group.\nOptional parameters:\n\tMembers: string array. Each string is mobile number(with country code). Max strings-100\n\t\n\tGroupType: Group/ConnectGroup. ConnectGroup for Managed public group."
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      },
      "get": {
        "description": "This API returns all direct groups attached with the user",
        "summary": "Fetch direct groups",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "FetchDirectGroups",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/groups",
              "headers": {
                "accessToken": "{{access-token}}"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "Step3 - Fetch groups - direct",
            "x-testDescription": "Fetch all direct groups"
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}": {
      "get": {
        "description": "This API can be used to fetch details for a group",
        "summary": "Fetch group details",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "FetchGroupDetails",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "applicationId",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "ID associated with the Connector"
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/subgroups": {
      "post": {
        "description": "API to create a group.\nOptional parameters:\n\tMembers: string array. Each string is mobile number(with country code). Max strings-100\n\t\n\tGroupType: Group/ConnectGroup. ConnectGroup for Managed public group.",
        "summary": "Create a  sub group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "CreateSubgroup",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Create a managed public group"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/subGroups": {
      "put": {
        "description": "Add group as a sub-group to another group",
        "summary": "This API allows lets addition of group as a sub-group to another group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "AddSubgroup",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Add group as a subGroup to another group"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      },
      "get": {
        "description": " Fetch sub-groups of a group",
        "summary": "This API is used to fetch sub-groups of a group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "FetchSubgroup",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "$ref": "#/definitions/Response - Fetch subGroup of a group"
            },
            "x-ms-example": {
              "application/json": {
                "groupName": "Kaizala Test group",
                "groupId": "5fe5b80a-52d1-4d8a-8086-cf8f34259de2",
                "groupImageUrl": "",
                "hasSubGroups": true,
                "hasParentGroups": false,
                "isMappedToTenant": false,
                "groupType": "Group",
                "subGroups": [
                  {
                    "groupName": "Kaizala Test sub group",
                    "groupId": "d15fce78-d5c5-410f-845d-a747f02de912",
                    "groupImageUrl": "",
                    "hasSubGroups": false,
                    "hasParentGroups": true,
                    "isMappedToTenant": false,
                    "groupType": "Group",
                    "isDuplicate": false,
                    "welcomeMessage": "Welcome to sub group created programmatically via Postman"
                  }
                ],
                "welcomeMessage": "Welcome to group created programmatically via Postman"
              }
            }
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/subGroups/{test-sub-group-id}": {
      "delete": {
        "description": "Remove group as a sub-group to another group",
        "summary": "Remove group as a sub-group to another group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "RemoveGroupAsSubgroup",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          },
          {
            "name": "test-sub-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/members": {
      "put": {
        "description": "This API lets addition of members to a group",
        "summary": "Add members to a group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "AddMembers",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Add members to a group"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      },
      "get": {
        "description": "This API returns list of members in a group",
        "summary": "Fetch members of a group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "FetchMembers",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/members/364388bc-5b7f-4857-a58c-31eba18e962e": {
      "delete": {
        "description": "This API allows removals of members from a group",
        "summary": "Remove members from a group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "RemoveMembers",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-public-group-id}/subscribers": {
      "post": {
        "description": "This API fetches list of subscribers of a managed public group",
        "summary": "Get Subscribers of a public group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "GetSubscribers",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Subscribers of a public group"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-public-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-public-group-id}/subscribers/add": {
      "put": {
        "description": "This API adds subscribers to a public group",
        "summary": "Add Subscribers to a public group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "AddSubscribers",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Remove subscribers"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-public-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-public-group-id}/subscribers/remove": {
      "put": {
        "description": "This API lets a user to remove subscribers from a public group",
        "summary": "Remove Subscribers from a public group",
        "tags": [
          "Group Management APIs"
        ],
        "operationId": "RemoveSubscribers",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Remove subscribers"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-public-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/media": {
      "post": {
        "description": "This API uploads media (image, document, audio, album or video)",
        "summary": "Upload media",
        "tags": [
          "Content Creation APIs"
        ],
        "operationId": "UploadMedia",
        "produces": [
          "application/json"
        ],
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "FileName",
            "in": "formData",
            "required": true,
            "type": "file",
            "format": "file",
            "description": ""
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-public-group-id}/messages": {
      "post": {
        "description": "This API lets you send a message to subscribers in a public group",
        "summary": "Send message to subscriber(s) in a public group",
        "tags": [
          "Content Creation APIs"
        ],
        "operationId": "SendMessageToSubscriber",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - SendMessageToSubscriber(s)InAPublicGroup"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-public-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/actions/{test-survey-id}/responses": {
      "post": {
        "description": "This API lets you post a response to a given survey",
        "summary": "Posting a response to a survey",
        "tags": [
          "Content Creation APIs"
        ],
        "operationId": "PostingSurveyResponse",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - PostingAResponseToASurvey"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          },
          {
            "name": "test-survey-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/actions/{test-action-id}/responses": {
      "post": {
        "description": "This API lets you post a response to an Action",
        "summary": "Posting a response to an action",
        "tags": [
          "Content Creation APIs"
        ],
        "operationId": "PostingActionResponse",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - PostingAResponseToAnAction"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          },
          {
            "name": "test-action-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with given Action"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/messages": {
      "post": {
        "description": "Send a message on a group",
        "summary": "Send message on a group",
        "tags": [
          "Content Creation APIs"
        ],
        "operationId": "SendMessage",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - SendMessageOnAGroup"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-public-group-id}/actions": {
      "post": {
        "description": "This API lets you post a custom action to subscibers in a public group",
        "summary": "Post custom action to subscriber(s) in a public group",
        "tags": [
          "Content Creation APIs"
        ],
        "operationId": "PostCustomActionSubscriber",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - Send Custom Action To Subscriber(s)"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "test-public-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given public group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/actions/{test-survey-id}": {
      "get": {
        "description": "This API lets you fetch responses for a survey",
        "summary": "Fetching survey responses",
        "tags": [
          "Content Query APIs"
        ],
        "operationId": "FetchingSurveyResponses",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "getDetails",
            "in": "query",
            "required": true,
            "type": "boolean",
            "description": ""
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          },
          {
            "name": "test-survey-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given survey"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/groups/{test-group-id}/actions": {
      "get": {
        "description": "Fetch jobs in a group",
        "summary": "Fetch jobs in a group",
        "tags": [
          "Content Query APIs"
        ],
        "operationId": "FetchJobs",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "actionType",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Type of Action"
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      },
      "post": {
        "description": "This API lets you create a survey and send on a group",
        "summary": "Send survey on a group",
        "tags": [
          "Content Creation APIs"
        ],
        "operationId": "SendSurvey",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - SendSurveyOnAGroup"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-group-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "GUID associated with the given group"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/webhook": {
      "get": {
        "description": "This API returns all webhooks on a group",
        "summary": "Get all webhooks on a group",
        "tags": [
          "Subscription Webhooks"
        ],
        "operationId": "GetAllWebhooks",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "objectId",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Identifier representing the object in which context the webhooks need to be created.For ObjectType=Group, its group's Identifier, For ObjectType=Action, its actionId, For ObjectType=ActionPackage, its action-package-id"
          },
          {
            "name": "objectType",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Enum: Group/Action/ActionPackage"
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/webhook?objectId={{test-group-id}}&objectType=Group",
              "headers": {
                "accessToken": "{{access-token}}"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "Get all webhooks on a group",
            "x-testDescription": "Get all webhooks on a group"
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      },
      "post": {
        "description": "Subscribe to all events at action level",
        "summary": "Subscribe to all events at action level",
        "tags": [
          "Subscription Webhooks"
        ],
        "operationId": "SubscribeToAllEvents",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/Request - SubscribeToAllEventsAtActionLevel"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [
          {
            "request": {
              "method": "POST",
              "uri": "/webhook",
              "headers": {
                "Content-Type": "application/json",
                "accessToken": "{{access-token}}"
              },
              "body": "{  \r\n   \"objectId\":\"{{test-action-id}}\",\r\n   \"objectType\":\"Action\",\r\n   \"eventTypes\":[  \r\n      \"ActionCreated\",\r\n      \"ActionResponse\"\r\n   ],\r\n   \"callBackUrl\":\"https://requestb.in/12786un1\",\r\n   \"callBackToken\":\"tokenToBeVerifiedByCallback\",\r\n   \"callBackContext\":\"Any data which is required to be returned in callback. Current webhook data can be seen by refreshing: https://requestb.in/12786un1?inspect\"\r\n}"
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "Subscribe to all events at action level",
            "x-testDescription": "Subscribe to all events at action level"
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/webhook/{test-webhook-id}": {
      "delete": {
        "description": "Unsubscribing a webhook",
        "summary": "Unsubscribing awebhook",
        "tags": [
          "Subscription Webhooks"
        ],
        "operationId": "UnsubscribingAWebhook",
        "produces": [
          "application/json"
        ],
        "x-ms-parameterized-host": {
          "hostTemplate": "{endpoint-url}"
        },
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Access Token received from the auth end-point"
          },
          {
            "name": "test-webhook-id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Identifier representing the webHook created"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    }
  },
  "definitions": {
    "Request - Add group as a subGroup to another group": {
      "title": "Add group as a sub-group to another group",
      "x-ms-example": {
        "subGroups": [
          "{{test-sub-group-id}}"
        ]
      },
      "type": "object",
      "properties": {
        "subGroups": {
          "description": "Array of groups with the list of subGroups if any",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "subGroups"
      ]
    },
    "Request - Create a managed public group": {
      "title": "Create a managed public group",
      "x-ms-example": {
        "name": "Kaizala Test Public Group",
        "welcomeMessage": "Welcome to public group created programmatically via Postman",
        "members": [
          "{{mobile-number-2}}"
        ],
        "groupType": "ConnectGroup"
      },
      "type": "object",
      "properties": {
        "name": {
          "description": "Group name",
          "type": "string"
        },
        "welcomeMessage": {
          "description": "Welcome message which will be displayed to new group member",
          "type": "string"
        },
        "members": {
          "description": "Mobile number(with country code) of members to be added. Default: Access token's user will be added as admin of the group",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groupType": {
          "description": "Enum: Group/ConnectGroup. ConnectGroup will create Managed Public group. Default: Group",
          "type": "string"
        }
      },
      "required": [
        "name",
        "welcomeMessage",
        "members",
        "groupType"
      ]
    },
    "Request - PostCustomActionToAGroup[withProperties]": {
      "title": "Post custom action to a group [with properties]",
      "x-ms-example": {
        "id": "com.microsoft.kaizala.miniapps.BdayMessage.12",
        "actionBody": {
          "properties": [
            {
              "name": "name",
              "value": "TestTitle",
              "type": "Text"
            },
            {
              "name": "occasion",
              "value": "birthday",
              "type": "Text"
            },
            {
              "name": "message",
              "value": "Test message",
              "type": "Text"
            }
          ]
        }
      },
      "type": "object",
      "properties": {
        "id": {
          "description": "Id for the Action Instance",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/CustomActionBody"
        }
      },
      "required": [
        "id",
        "actionBody"
      ]
    },
    "CustomActionBody": {
      "title": "CustomActionBody",
      "type": "object",
      "properties": {
        "properties": {
          "description": "Each element of object[] is described below as Property Object. Only valid for creating Action Package Instance",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Property"
          }
        }
      },
      "required": [
        "properties"
      ]
    },
    "Property": {
      "title": "Property",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the property",
          "type": "string"
        },
        "value": {
          "description": "Type of the property. Enum: Text, Numeric, Location, DateTime, StringList, Attachment, StringSet, AttachmentList",
          "type": "string"
        },
        "type": {
          "description": "Value of the property",
          "type": "string"
        }
      },
      "required": [
        "name",
        "value",
        "type"
      ]
    },
    "Request - PostAJobOnAGroup": {
      "title": "Post a job on a group",
      "x-ms-example": {
        "actionType": "Job",
        "actionBody": {
          "title": "test job",
          "assignedTo": [
            "{{mobile-number}}"
          ],
          "dueDate": 10
        }
      },
      "type": "object",
      "properties": {
        "actionType": {
          "description": "Type of Action. Value: Job",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/JobActionBody"
        }
      },
      "required": [
        "actionType",
        "actionBody"
      ]
    },
    "JobActionBody": {
      "title": "JobActionBody",
      "type": "object",
      "properties": {
        "title": {
          "description": "Title of the Job",
          "type": "string"
        },
        "assignedTo": {
          "description": "Array of mobile numbers for the persons to whom Job is assigned",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dueDate": {
          "description": "Default: 24hrs. Number of hours before which job should be completed",
          "type": "integer",
          "format": "int32"
        }
      },
      "required": [
        "title",
        "assignedTo",
        "dueDate"
      ]
    },
    "Request - SendImageOnAGroup": {
      "title": "Send image on a group",
      "x-ms-example": {
        "actionType": "Image",
        "actionBody": {
          "caption": "Image caption",
          "mediaResource": "eyJUaHVtYm5haWwiOiIvOWovNEFBUVNrWkpSZ0FCQVFFQVlBQmdBQUQvMndCREFJVmNaSFZrVTRWMWJIV1dqb1dleVAvWnlMZTN5UC8vLy9MLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8yd0JEQVk2V2xzaXZ5UC9aMmYvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL3dBQVJDQUNTQVFRREFTSUFBaEVCQXhFQi84UUFId0FBQVFVQkFRRUJBUUVBQUFBQUFBQUFBQUVDQXdRRkJnY0lDUW9MLzhRQXRSQUFBZ0VEQXdJRUF3VUZCQVFBQUFGOUFRSURBQVFSQlJJaE1VRUdFMUZoQnlKeEZES0JrYUVJSTBLeHdSVlMwZkFrTTJKeWdna0tGaGNZR1JvbEppY29LU28wTlRZM09EazZRMFJGUmtkSVNVcFRWRlZXVjFoWldtTmtaV1puYUdscWMzUjFkbmQ0ZVhxRGhJV0doNGlKaXBLVGxKV1dsNWlabXFLanBLV21wNmlwcXJLenRMVzJ0N2k1dXNMRHhNWEd4OGpKeXRMVDFOWFcxOWpaMnVIaTQrVGw1dWZvNmVyeDh2UDA5ZmIzK1BuNi84UUFId0VBQXdFQkFRRUJBUUVCQVFBQUFBQUFBQUVDQXdRRkJnY0lDUW9MLzhRQXRSRUFBZ0VDQkFRREJBY0ZCQVFBQVFKM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Fzd2pGVll5cUdxeUtnNmNkTWRVUW1pQWV6OHNWOTUxVVNjVW1MekxrJTNEJnN0PTIwMTctMDUtMTdUMDclM0EwNCUzQTQxWiZzZT0yMjkxLTAzLTAyVDA4JTNBMDQlM0E0MVomc3A9ciJ9XX0="
        }
      },
      "type": "object",
      "properties": {
        "actionType": {
          "description": "Type of Action",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/ImageActionBody"
        }
      },
      "required": [
        "actionType",
        "actionBody"
      ]
    },
    "ImageActionBody": {
      "title": "Image Action Body",
      "type": "object",
      "properties": {
        "caption": {
          "description": "Text Message that would be sent along with the Image",
          "type": "string"
        },
        "mediaResource": {
          "description": "MediaResource string from a previous call to /media where you need to upload the attachment",
          "type": "string"
        }
      },
      "required": [
        "caption",
        "mediaResource"
      ]
    },
    "Request - SubscribeToAllEventsAtActionLevelWithActionPackageId": {
      "title": "Subscribe to all events at action level with action package id",
      "x-ms-example": {
        "objectId": "25b39b30-0806-4d17-b6a7-a39f21fa52e9",
        "objectType": "ActionPackage",
        "eventTypes": [
          "ActionCreated",
          "ActionResponse"
        ],
        "callBackUrl": "https://requestb.in/12786un1",
        "callBackToken": "tokenToBeVerifiedByCallback",
        "callBackContext": "Any data which is required to be returned in callback. Current webhook data can be seen by refreshing: https://requestb.in/12786un1?inspect"
      },
      "type": "object",
      "properties": {
        "objectId": {
          "description": "Identifier representing the object in which context the webhooks need to be created.For ObjectType=Group, its group's Identifier, For ObjectType=Action, its actionId, For ObjectType=ActionPackage, its action-package-id",
          "type": "string"
        },
        "objectType": {
          "description": "Enum:Group/Action/ActionPackage",
          "type": "string"
        },
        "eventTypes": {
          "description": "Array of different types of events you need to subscribe the webhook to. Supported events are: ActionCreated,ActionResponse,SurveyCreated,JobCreated,SurveyResponse,JobResponse,TextMessageCreated,AttachmentCreated,Announcement,MemberAdded,MemberRemoved,GroupAdded,GroupRemoved",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "callBackUrl": {
          "description": "HTTPS URL to which the subscribed events need to be notified to",
          "type": "string"
        },
        "callBackToken": {
          "description": "Optional parameter you can set which will be sent in the HTTP header 'kz-callback-token' with every callBack made by the WebHook ",
          "type": "string"
        },
        "callBackContext": {
          "description": "Optional parameter you can set which will be sent in the JSON payload as 'context' with every callBack made by the WebHook ",
          "type": "string"
        }
      },
      "required": [
        "objectId",
        "objectType",
        "eventTypes",
        "callBackUrl",
        "callBackToken",
        "callBackContext"
      ]
    },
    "Request - SendMessageToSubscriber(s)InAPublicGroup": {
      "title": "Send message to subscriber(s) in a public group",
      "x-ms-example": {
        "Message": "message to subscribers",
        "subscribers": [
          "{{mobile-number-3}}"
        ],
        "sendToAllSubscribers": false
      },
      "type": "object",
      "properties": {
        "Message": {
          "description": "Text message to be sent (Max limit of 1000 Characters)",
          "type": "string"
        },
        "subscribers": {
          "description": "Each element corresponds to a mobile number(with country code. Eg. +911999999999). Text message will be sent only to the selected subscribers. To be used for selective communication to subscribers in context of a Public Group",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sendToAllSubscribers": {
          "description": "Default: false. Valid only in case the groupId belongs to a Public Group. True to send the text message to all subscribers which requires the token's user to be admin of the Public Group",
          "type": "boolean"
        }
      },
      "required": [
        "Message",
        "subscribers",
        "sendToAllSubscribers"
      ]
    },
    "Request - Add members to a group": {
      "title": "Add members to a group",
      "x-ms-example": {
        "members": [
          "{{mobile-number-2}}"
        ]
      },
      "type": "object",
      "properties": {
        "members": {
          "description": "Array of phone numbers(with countrycode) of new members to be added",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "members"
      ]
    },
    "Request - SubscribeToAllEventsAtGroupLevel": {
      "title": "Subscribe to all events at group levelRequest",
      "x-ms-example": {
        "objectId": "{{test-group-id}}",
        "objectType": "Group",
        "eventTypes": [
          "ActionCreated",
          "ActionResponse",
          "SurveyCreated",
          "JobCreated",
          "SurveyResponse",
          "JobResponse",
          "TextMessageCreated",
          "AttachmentCreated",
          "Announcement",
          "MemberAdded",
          "MemberRemoved",
          "GroupAdded",
          "GroupRemoved"
        ],
        "callBackUrl": "https://requestb.in/12786un1",
        "callBackToken": "tokenToBeVerifiedByCallback",
        "callBackContext": "Any data which is required to be returned in callback. Current webhook data can be seen by refreshing: https://requestb.in/12786un1?inspect"
      },
      "type": "object",
      "properties": {
        "objectId": {
          "description": "Identifier representing the object in which context the webhooks need to be created.For ObjectType=Group, its group's Identifier, For ObjectType=Action, its actionId, For ObjectType=ActionPackage, its action-package-id",
          "type": "string"
        },
        "objectType": {
          "description": "Enum:Group/Action/ActionPackage",
          "type": "string"
        },
        "eventTypes": {
          "description": "Array of different types of events you need to subscribe the webhook to. Supported events are: ActionCreated,ActionResponse,SurveyCreated,JobCreated,SurveyResponse,JobResponse,TextMessageCreated,AttachmentCreated,Announcement,MemberAdded,MemberRemoved,GroupAdded,GroupRemoved",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "callBackUrl": {
          "description": "HTTPS URL to which the subscribed events need to be notified to",
          "type": "string"
        },
        "callBackToken": {
          "description": "Optional parameter you can set which will be sent in the HTTP header 'kz-callback-token' with every callBack made by the WebHook ",
          "type": "string"
        },
        "callBackContext": {
          "description": "Optional parameter you can set which will be sent in the JSON payload as 'context' with every callBack made by the WebHook ",
          "type": "string"
        }
      },
      "required": [
        "objectId",
        "objectType",
        "eventTypes",
        "callBackUrl",
        "callBackToken",
        "callBackContext"
      ]
    },
    "Request - PostingAResponseToASurvey": {
      "title": "Posting a response to a survey",
      "type": "object",
      "properties": {
        "actionType": {
          "description": "Type of action",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/SurveyActionBody"
        }
      },
      "required": [
        "actionType",
        "actionBody"
      ]
    },
    "SurveyActionBody": {
      "title": "Survey Action Body",
      "type": "object",
      "properties": {
        "responseName": {
          "description": "Name of the response",
          "type": "string"
        },
        "responseLocation": {
          "$ref": "#/definitions/ResponseLocation"
        },
        "Answers": {
          "description": "",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Answer"
          }
        }
      },
      "required": [
        "responseName",
        "responseLocation",
        "Answers"
      ]
    },
    "ResponseLocation": {
      "title": "ResponseLocation",
      "type": "object",
      "properties": {
        "latitude": {
          "description": "Latitude coordinates for the location",
          "type": "integer",
          "format": "int32"
        },
        "longitude": {
          "description": "Longitude coordinates for the location",
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "description": "Name of the Place that Location co-ordinates corresponds to",
          "type": "string"
        }
      },
      "required": [
        "latitude",
        "longitude",
        "name"
      ]
    },
    "Answer": {
      "title": "Answer",
      "type": "object",
      "properties": {
        "lt": {
          "description": "Latitude coordinates for the location",
          "type": "integer",
          "format": "int32"
        },
        "lg": {
          "description": "Longitude coordinates for the location",
          "type": "integer",
          "format": "int32"
        },
        "n": {
          "description": "",
          "type": "string"
        }
      }
    },
    "Response - Access Token": {
      "title": "Retrieve the Access Token",
      "x-ms-example": {
        "accessToken": "asdasadadaad",
        "endpointUrl": "https://inc-000.KaizalaMessaging.osi.office.net",
        "accessTokenExpiry": 1505566877207,
        "scope": "token.write"
      },
      "type": "object",
      "properties": {
        "accessToken": {
          "description": "Access Token received from the auth end-point",
          "type": "string"
        },
        "endpointUrl": {
          "description": "On successful auth, an endpoint url is returned that should be used as api-base-url for making subsequent API calls",
          "type": "string"
        },
        "accessTokenExpiry": {
          "description": "It indicates the expiry time for accessToken in epoch time(milliseconds)",
          "type": "integer",
          "format": "int32"
        },
        "scope": {
          "description": "Scope of permissions on Kaizala resources that given Access Token provides",
          "type": "string"
        }
      },
      "required": [
        "accessToken",
        "endpointUrl",
        "accessTokenExpiry",
        "scope"
      ]
    },
    "Request - PostingAResponseToAnAction": {
      "title": "Posting a response to an action",
      "x-ms-example": {
        "id": "25b39b30-0806-4d17-b6a7-a39f21fa52e9",
        "actionBody": {
          "Answers": [
            "test text"
          ]
        }
      },
      "type": "object",
      "properties": {
        "id": {
          "description": "ID associated with the Action Instance",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/Request - Action Body"
        },
        "responseId": {
          "description": "For updating existing response",
          "type": "string"
        },
        "actionType": {
          "description": "Enum values: Survey/Job. Either of actionType or Id should be specified",
          "type": "string"
        }
      },
      "required": [
        "id",
        "actionBody",
        "actionType"
      ]
    },
    "Request - Action Body": {
      "title": "Action Body",
      "description": "Object representing data needed for the respective Action. Parameters would vary according to different Action-type.",
      "type": "object",
      "properties": {
        "Answers": {
          "description": "Array of Response items for the given Action.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "Answers"
      ]
    },
    "Request - Remove subscribers": {
      "title": "Remove Subscribers from a public group",
      "x-ms-example": {
        "subscribers": [
          "{{mobile-number-3}}"
        ]
      },
      "type": "object",
      "properties": {
        "subscribers": {
          "description": "List of subscriber mobile number with country code",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "subscribers"
      ]
    },
    "Request - Generate pin": {
      "title": "Generate Pin",
      "x-ms-example": {
        "mobileNumber": "{{mobile-number}}",
        "applicationId": "{{application-id}}"
      },
      "type": "object",
      "properties": {
        "mobileNumber": {
          "description": "Mobile Number for which PIN would be generated",
          "type": "string"
        },
        "applicationId": {
          "description": "ID associated with the Connector",
          "type": "string"
        }
      },
      "required": [
        "mobileNumber",
        "applicationId"
      ]
    },
    "Request - SendMessageOnAGroup": {
      "title": "Send message on a group",
      "x-ms-example": {
        "message": "Test message via API"
      },
      "type": "object",
      "properties": {
        "message": {
          "description": "Text Message that would be sent in the group",
          "type": "string"
        }
      },
      "required": [
        "message"
      ]
    },
    "Request - PostCustomAnnouncementToAGroup": {
      "title": "Post announcement to a group",
      "x-ms-example": {
        "actiontype": "Announcement",
        "actionBody": {
          "message": "Lets test announcement"
        }
      },
      "type": "object",
      "properties": {
        "actiontype": {
          "description": "Type of Action. Value: Announcement",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/AnnouncementBodyRequest"
        }
      },
      "required": [
        "actiontype",
        "actionBody"
      ]
    },
    "AnnouncementBodyRequest": {
      "title": "Announcement Body Request",
      "type": "object",
      "properties": {
        "message": {
          "description": "Message that would be sent as Announcement",
          "type": "string"
        }
      },
      "required": [
        "message"
      ]
    },
    "Request - Send Custom Action To Subscriber(s)": {
      "title": "Post custom action to subscriber(s) in a public group",
      "x-ms-example": {
        "id": "25b39b30-0806-4d17-b6a7-a39f21fa52e9",
        "actionBody": {
          "title": "override title",
          "validity": 24
        },
        "subscribers": [
          "{{mobile-number-3}}"
        ],
        "sendToAllSubscribers": false
      },
      "type": "object",
      "properties": {
        "id": {
          "description": "Action Package id",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/SubscribersCustomActionBody"
        },
        "subscribers": {
          "description": "",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sendToAllSubscribers": {
          "description": "",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "actionBody",
        "subscribers",
        "sendToAllSubscribers"
      ]
    },
    "SubscribersCustomActionBody": {
      "title": "Custom Action sent to a subscriber",
      "type": "object",
      "properties": {
        "title": {
          "description": "Title",
          "type": "string"
        },
        "validity": {
          "description": "Validity",
          "type": "integer",
          "format": "int32"
        }
      },
      "required": [
        "title",
        "validity"
      ]
    },
    "Request - PostCustomAnnouncementToAGroup[withImages]": {
      "title": "Post custom announcement to a group [with images]",
      "x-ms-example": {
        "actionType": "Announcement",
        "actionBody": {
          "Message": "Test announcement via API 2",
          "MediaResources": [
            "eyJUaHVtYm5haWwiOiIvOWovNEFBUVNrWkpSZ0FCQVFFQVlBQmdBQUQvMndCREFJVmNaSFZrVTRWMWJIV1dqb1dleVAvWnlMZTN5UC8vLy9MLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8yd0JEQVk2V2xzaXZ5UC9aMmYvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL3dBQ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WlnQW9vb29BS0tLS0FDaWlpZ0Fvb29vQUtLS0tBQ2lpaWdBb29vb0FLS0tLQUNpaWlnQW9vb29BS0tLS0FDaWlpZ0Fvb29vQUtLS0tBQ2lpaWdBb29vb0FLS0tLQUNpaWlnQW9vb29BS0tLS0FDaWlpZ0Fvb29vQUtLS0tBQ2lpaWdELzlrPSIsIkFjdGlvblR5cGUiOjMsIkZpbGVzIjpbeyJJZCI6ImU1Y2YyMWJmLWQ3OGItNGY4Yi1iYjY3LTM2NTJlNDk1ZDEyZSIsIk5hbWUiOiJ0ZXN0LnBuZyIsIlNpemUiOjQsIlVybCI6Imh0dHBzOi8vY2RuLmthc2NvcmUub3NpLm9mZmljZS5uZXQvNzVlOGU3YjYzZDJhNGMxMGNkYzMwMjA4YWEyN2YxYzI5ODdkODY4YTBlNzY0ZmM3NDJhOTRmNjU0OWQ4YmRiMi5wbmc/c3Y9MjAxNS0xMi0xMSZzcj1iJnNpZz00aXFzd2pGVll5cUdxeUtnNmNkTWRVUW1pQWV6OHNWOTUxVVNjVW1MekxrJTNEJnN0PTIwMTctMDUtMTdUMDclM0EwNCUzQTQxWiZzZT0yMjkxLTAzLTAyVDA4JTNBMDQlM0E0MVomc3A9ciJ9XX0="
          ]
        }
      },
      "type": "object",
      "properties": {
        "actionType": {
          "description": "Type of Action. Value: Announcement ",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/AnnouncementwithImage"
        }
      },
      "required": [
        "actionType",
        "actionBody"
      ]
    },
    "AnnouncementwithImage": {
      "title": "Announcement Body with Images",
      "type": "object",
      "properties": {
        "Message": {
          "description": "Message that will be sent in the group",
          "type": "string"
        },
        "MediaResources": {
          "description": "Array of media resource objects",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "Message",
        "MediaResources"
      ]
    },
    "Request - Refresh Token": {
      "title": "Login with pin and applicationId to get refresh token",
      "x-ms-example": {
        "mobileNumber": "{{mobile-number}}",
        "applicationId": "{{application-id}}",
        "pin": 8876
      },
      "type": "object",
      "properties": {
        "mobileNumber": {
          "description": "Mobile Number for which token would be generated",
          "type": "string"
        },
        "applicationId": {
          "description": "ID associated with the Connector",
          "type": "string"
        },
        "pin": {
          "description": "OTP sent to the given mobile number",
          "type": "integer",
          "format": "int32"
        }
      },
      "required": [
        "mobileNumber",
        "applicationId",
        "pin"
      ]
    },
    "Response - Refresh Token": {
      "title": "Login with pin and applicationId to get refresh token",
      "x-ms-example": {
        "refreshToken": "adwawaw",
        "grantedScope": "groupinfo.read,groupinfo.write,groupinfo.remove,groupinfo.update,groupmember.read,groupmember.write,groupmember.remove,textmessage.read,action.read,action.write,action.update,profile.write,media.read,webhook.read,webhook.write,webhook.remove,webhook.update",
        "refreshTokenExpiry": 1537016388242
      },
      "type": "object",
      "properties": {
        "refreshToken": {
          "description": "refreshToken shared by the Kaizala Group Admin when the respective Connector was granted access to the group",
          "type": "string"
        },
        "grantedScope": {
          "description": "Access Scope that the given Application/Connector has been granted",
          "type": "string"
        },
        "refreshTokenExpiry": {
          "description": "It indicates the expiry time for refreshToken in epoch time(milliseconds)",
          "type": "integer",
          "format": "int32"
        }
      },
      "required": [
        "refreshToken",
        "grantedScope",
        "refreshTokenExpiry"
      ]
    },
    "Response - Fetch subGroup of a group": {
      "title": "Fetch sub-group(s) for a group",
      "x-ms-example": {
        "groupName": "Kaizala Test group",
        "groupId": "5fe5b80a-52d1-4d8a-8086-cf8f34259de2",
        "groupImageUrl": "",
        "hasSubGroups": true,
        "hasParentGroups": false,
        "isMappedToTenant": false,
        "groupType": "Group",
        "subGroups": [
          {
            "groupName": "Kaizala Test sub group",
            "groupId": "d15fce78-d5c5-410f-845d-a747f02de912",
            "groupImageUrl": "",
            "hasSubGroups": false,
            "hasParentGroups": true,
            "isMappedToTenant": false,
            "groupType": "Group",
            "isDuplicate": false,
            "welcomeMessage": "Welcome to sub group created programmatically via Postman"
          }
        ],
        "welcomeMessage": "Welcome to group created programmatically via Postman"
      },
      "type": "object",
      "properties": {
        "groupName": {
          "description": "Name of the group",
          "type": "string"
        },
        "groupId": {
          "description": "GUID associated with the group",
          "type": "string"
        },
        "groupImageUrl": {
          "description": "String specifying the URL of the group profile picture ",
          "type": "string"
        },
        "hasSubGroups": {
          "description": "Returns true, if the group has subGroups",
          "type": "boolean"
        },
        "hasParentGroups": {
          "description": "Returns true, if the group has parent Groups",
          "type": "boolean"
        },
        "isMappedToTenant": {
          "description": "Returns true, if the group is mapped as Organization Group",
          "type": "boolean"
        },
        "groupType": {
          "description": "Group/ Connect Group. Connect Group refers to Managed Public Group.",
          "type": "string"
        },
        "subGroups": {
          "description": "Array of Subgroups that given group has",
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubGroup"
          }
        },
        "welcomeMessage": {
          "description": "Welcome Message that is shown to new joinees in the group",
          "type": "string"
        }
      },
      "required": [
        "groupName",
        "groupId",
        "groupImageUrl",
        "hasSubGroups",
        "hasParentGroups",
        "isMappedToTenant",
        "groupType",
        "subGroups",
        "welcomeMessage"
      ]
    },
    "SubGroup": {
      "title": "SubGroup",
      "type": "object",
      "properties": {
        "groupName": {
          "description": "Name of the group",
          "type": "string"
        },
        "groupId": {
          "description": "GUID associated with the group",
          "type": "string"
        },
        "groupImageUrl": {
          "description": "String specifying the URL of the group profile picture ",
          "type": "string"
        },
        "hasSubGroups": {
          "description": "Returns true, if the group has subGroups",
          "type": "boolean"
        },
        "hasParentGroups": {
          "description": "Returns true, if the group has parent Groups",
          "type": "boolean"
        },
        "isMappedToTenant": {
          "description": "Returns true, if the group is mapped as Organization Group",
          "type": "boolean"
        },
        "groupType": {
          "description": "Group/ Connect Group. Connect Group refers to Managed Public Group.",
          "type": "string"
        },
        "isDuplicate": {
          "description": "Returns true, if provided groupid already exists",
          "type": "boolean"
        },
        "welcomeMessage": {
          "description": "Welcome Message that is shown to new joinees in the group ",
          "type": "string"
        }
      },
      "required": [
        "groupName",
        "groupId",
        "groupImageUrl",
        "hasSubGroups",
        "hasParentGroups",
        "isMappedToTenant",
        "groupType",
        "isDuplicate",
        "welcomeMessage"
      ]
    },
    "Response - Create a group": {
      "x-ms-example": {
        "groupId": "jhj5fe5b80a-52d1-4d8a-8086-cf8f34259de2",
        "groupName": "Test group",
        "membersAdded": true
      },
      "type": "object",
      "properties": {
        "groupId": {
          "description": "Group Identifier which can be used in subsequent API calls ",
          "type": "string"
        },
        "groupName": {
          "description": "Group name",
          "type": "string"
        },
        "membersAdded": {
          "description": "True if all members are successfully added ",
          "type": "boolean"
        }
      },
      "required": [
        "groupId",
        "groupName",
        "membersAdded"
      ]
    },
    "Request - Subscribers of a public group": {
      "title": "Get Subscribers of a public group",
      "type": "object",
      "properties": {
        "count": {
          "description": "Number of Subscribers in the Public Group",
          "type": "integer",
          "format": "int32"
        },
        "cursor": {
          "description": "Start of resultset. For pagination. To be used in Request body for fetching next result set. Present in response only if there is a valid next result set.",
          "type": "string"
        }
      },
      "required": [
        "count",
        "cursor"
      ]
    },
    "Request - SubscribeToAllEventsAtActionLevel": {
      "title": "Subscribe to all events at action level",
      "x-ms-example": {
        "objectId": "{{test-action-id}}",
        "objectType": "Action",
        "eventTypes": [
          "ActionCreated",
          "ActionResponse"
        ],
        "callBackUrl": "https://requestb.in/12786un1",
        "callBackToken": "tokenToBeVerifiedByCallback",
        "callBackContext": "Any data which is required to be returned in callback. Current webhook data can be seen by refreshing: https://requestb.in/12786un1?inspect"
      },
      "type": "object",
      "properties": {
        "objectId": {
          "description": "",
          "type": "string"
        },
        "objectType": {
          "description": "",
          "type": "string"
        },
        "eventTypes": {
          "description": "",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "callBackUrl": {
          "description": "",
          "type": "string"
        },
        "callBackToken": {
          "description": "",
          "type": "string"
        },
        "callBackContext": {
          "description": "",
          "type": "string"
        }
      },
      "required": [
        "objectId",
        "objectType",
        "eventTypes",
        "callBackUrl",
        "callBackToken",
        "callBackContext"
      ]
    },
    "Request - PostCustomActionOnAGroup": {
      "title": "Post custom action on a group",
      "x-ms-example": {
        "id": "25b39b30-0806-4d17-b6a7-a39f21fa52e9",
        "actionBody": {
          "title": "override title",
          "validity": 24
        }
      },
      "type": "object",
      "properties": {
        "id": {
          "description": "",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/CustomActionBody"
        }
      },
      "required": [
        "id",
        "actionBody"
      ]
    },
    "Request - SendSurveyOnAGroup": {
      "title": "Send survey on a group",
      "x-ms-example": {
        "actionType": "Survey",
        "actionBody": {
          "isAnonymous": false,
          "isSenderOnly": false,
          "acceptMultipleResponses": true,
          "dueDate": 10,
          "title": "A test survey!!",
          "questions": [
            {
              "title": "a test question written here",
              "type": "Text"
            },
            {
              "title": "Single select question",
              "type": "SingleOption",
              "options": [
                {
                  "title": "Opt1"
                },
                {
                  "title": "Opt2"
                }
              ]
            },
            {
              "title": "Multi select question",
              "type": "MultiOption",
              "options": [
                {
                  "title": "MOpt1"
                },
                {
                  "title": "MOpt2"
                },
                {
                  "title": "MOpt3"
                }
              ]
            },
            {
              "title": "Numeric question",
              "type": "Numeric"
            },
            {
              "title": "Location question",
              "type": "Location"
            },
            {
              "title": "DateTime question",
              "type": "DateTime"
            },
            {
              "title": "Image question",
              "type": "Image"
            }
          ]
        }
      },
      "type": "object",
      "properties": {
        "actionType": {
          "description": "",
          "type": "string"
        },
        "actionBody": {
          "$ref": "#/definitions/Request - SurveyActionBody"
        }
      },
      "required": [
        "actionType",
        "actionBody"
      ]
    },
    "Request - SurveyActionBody": {
      "title": "Survey Action Body",
      "type": "object",
      "properties": {
        "isAnonymous": {
          "description": "",
          "type": "boolean"
        },
        "isSenderOnly": {
          "description": "",
          "type": "boolean"
        },
        "acceptMultipleResponses": {
          "description": "",
          "type": "boolean"
        },
        "dueDate": {
          "description": "",
          "type": "integer",
          "format": "int32"
        },
        "title": {
          "description": "",
          "type": "string"
        },
        "questions": {
          "description": "",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Question"
          }
        }
      },
      "required": [
        "isAnonymous",
        "isSenderOnly",
        "acceptMultipleResponses",
        "dueDate",
        "title",
        "questions"
      ]
    },
    "Question": {
      "title": "Question",
      "type": "object",
      "properties": {
        "title": {
          "description": "",
          "type": "string"
        },
        "type": {
          "description": "",
          "type": "string"
        },
        "options": {
          "description": "",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Option"
          }
        }
      },
      "required": [
        "title",
        "type"
      ]
    },
    "Option": {
      "title": "Option",
      "type": "object",
      "properties": {
        "title": {
          "description": "",
          "type": "string"
        }
      },
      "required": [
        "title"
      ]
    }
  }
}