Alerts Panel - User Guide
AlertsPanel APIs
7 min
inroduction inroduction engati apis allow you to integrate with the platform and create useful functionality around the platform the apis are rest based using json as the standard response type headers api keys need to be added to the authorization header as follows – authorization basic \<authorization key> the api keys can be generated by going to alertspanel api section engati apis follow basic authentication utilizing api keys to authenticate the api calls the api keys can be revoked or regenerated at any point in time and would throw authentication errors for the api calls made using them { "tab" "examples", "url" "https //api alertspanel com", "name" "alertspanel apis", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "keltcmns8tbz5b30bmdy ", "code" "{\n \\"responseobject\\" true\n}", "language" "200", "customlabel" "" }, { "id" "aw tt2mo1dwcgf 4c9xwp", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n }", "language" "404", "customlabel" "" } ], "selectedlanguageid" "keltcmns8tbz5b30bmdy " }, "examples" { "languages" \[ { "id" "s6zzpicp khm klwsha4f", "code" "curl location request get 'https //api alertspanel com/bot api/v1 0/customer/61179/bot/bb67e0773bed4c7e/users?attribute name=opt1\&attribute value=yes' \\\\\n header 'authorization basic 2082e8f4 0011 479b 9edb 74293c62d91b gkouziq' \\\\\n header 'content type application/json' \\\\\n data raw ''", "language" "curl", "customlabel" "users" }, { "id" "atvkd tpyg doqfof92bz", "code" "curl location request get 'https //api alertspanel com/bot api/v1 0/customer/61179/bot/bb67e0773bed4c7e/channel user/919565428256/conversations' \\\\\n header 'authorization basic 2082e8f4 0011 479b 9edb 74293c62d91b gkouziq' \\\\\n header 'content type application/json' \\\\\n data raw ''", "language" "curl", "customlabel" "conversation history" }, { "id" "ybcwzhfmluyxoadhw1ap ", "code" "curl location request post 'https //api alertspanel com/whatsapp api/v1 0/customer/49373/bot/f5afdd1c000742f0/template' \\\\\n header 'authorization basic 1b051089 77b5 4a97 ad8e f3186a6a7532 fqxcfmw' \\\\\n header 'content type application/json' \\\\\n data raw '{\n \\"phonenumber\\" \\"+919019486731\\",\n \\"payload\\" {\n \\"components\\" \[\n {\n \\"type\\" \\"header\\",\n \\"parameters\\" \[\n {\n \\"type\\" \\"document\\",\n \\"document\\" {\n \\"filename\\" \\"uribapplicationform 82121086 pdf\\",\n \\"link\\" \\"https //s3 ap south 1 amazonaws com/file upload public/prod/61179/broadcast template attachment/75549 uribapplicationform 82121086 pdf\\"\n }\n }\n ]\n },\n {\n \\"type\\" \\"body\\",\n \\"parameters\\" \[\n {\n \\"type\\" \\"text\\",\n \\"text\\" \\"john\\"\n },{\n \\"type\\" \\"text\\",\n \\"text\\" \\"john\\"\n },{\n \\"type\\" \\"text\\",\n \\"text\\" \\"john\\"\n }\n ]\n },\n {\n \\"index\\" 0,\n \\"parameters\\" \[\n {\n \\"payload\\" \\"flow 7bbb608c3b4b4e848f36cd2ccd7cfa35||data personx response=declined invoice no 12345\\",\n \\"type\\" \\"payload\\"\n }\n ],\n \\"sub type\\" \\"quick reply\\",\n \\"type\\" \\"button\\"\n },\n {\n \\"index\\" 1,\n \\"parameters\\" \[\n {\n \\"payload\\" \\"flow e30d44bcca4c49d49976d3ac0416c405||data personx response=approved invoice no 12345\\",\n \\"type\\" \\"payload\\"\n }\n ],\n \\"sub type\\" \\"quick reply\\",\n \\"type\\" \\"button\\"\n }\n ],\n \\"namespace\\" \\"980c3243 2d2a 4d2d a572 b2a50552cb04\\",\n \\"name\\" \\"renuka sugars paytest\\",\n \\"language\\" {\n \\"policy\\" \\"deterministic\\",\n \\"code\\" \\"en\\"\n }\n }\n}\n}'", "language" "curl", "customlabel" "whatsapp broadcast" }, { "id" "snotmb7v7mba2uurq2m10", "code" "curl location request post 'https //api alertspanel com/bot api/v1 0/customer/61179/bot/bb67e0773bed4c7e/broadcast' \\\\\n header 'authorization basic 2082e8f4 0011 479b 9edb 74293c62d91b gkouziq' \\\\\n header 'content type application/json' \\\\\n data raw '{\n\\"broadcastid\\" null,\n\\"broadcasttitle\\" \\"testing broadcast\\",\n\\"publishedon\\" \\"2019 06 03t06 48 27 170z\\",\n\\"audience\\" {\n\\"rule\\" {\n\\"channels\\" \[\\"whatsapp\\"],\n\\"channeluserids\\" \[\\"919019486731\\"]\n}\n},\n\\"payload\\" {\n\\"type\\" \\"direct\\",\n\\"content\\" \[\n{\n\\"type\\" \\"text\\",\n\\"data\\" {\n\\"message\\" \\"this is a test message\\"\n}\n},\n{\n\\"type\\" \\"text\\",\n\\"data\\" {\n\\"message\\" \\"this is another message\\"\n}\n}\n]\n},\n\\"status\\" null\n}\n'", "language" "json", "customlabel" "broadcast" }, { "id" "fiz3qaxxvf4apscodbx9a", "code" "curl location request post 'https //api engati com/bot api/v1 0/customer/61179/bot/bb67e0773bed4c7e/flow/default fallback msg 74963' \\\\\n header 'authorization basic 2082e8f4 0011 479b 9edb 74293c62d91b gkouziq' \\\\\n header 'content type application/json' \\\\\n data raw ''", "language" "curl", "customlabel" "api triggers" }, { "id" "sje6oda1qufydejy h0y5", "code" "curl location 'https //api alertspanel com/bot api/v1 0/customer/61179/bot/0ab20e4b037345d0/broadcast' \\\\\n header 'authorization basic 000b0a2a 0231 41ce 81b3 55a6de06fb65 gthkwxy' \\\\\n header 'content type application/json' \\\\\n data '{\n \\"broadcastid\\" null,\n \\"broadcasttitle\\" \\"f1\\",\n \\"publishedon\\" \\"2023 04 04t10 54 00 000z\\",\n \\"audience\\" {\n \\"rule\\" {\n \\"userids\\" \[],\n \\"channeluserids\\" \[\n \\"9178921978038123\\",\\"9190193486731\\"\n ],\n \\"channels\\" \[\n \\"whatsapp\\"\n ]\n }\n },\n \\"payload\\" {\n \\"type\\" \\"whatsapp template\\",\n \\"campaignkey\\" null,\n \\"content\\" \[\n {\n \\"type\\" \\"template\\",\n \\"data\\" null,\n \\"template\\" {\n \\"payload\\" {\n \\"namespace\\" \\"980c3243 2d2a 4d2d a572 b2a50552cb04\\",\n \\"name\\" \\"diwali offer\\",\n \\"components\\" \[\n {\n \\"type\\" \\"body\\",\n \\"parameters\\" \[\n {\n \\"type\\" \\"text\\",\n \\"text\\" \\"john \\"\n },\n {\n \\"type\\" \\"text\\",\n \\"text\\" \\"adam\\"\n }\n ]\n },\n {\n \\"index\\" 0,\n \\"parameters\\" \[\n {\n \\"payload\\" \\"flow welcome 88601\\",\n \\"type\\" \\"payload\\"\n }\n ],\n \\"sub type\\" \\"quick reply\\",\n \\"type\\" \\"button\\"\n },\n {\n \\"index\\" 1,\n \\"parameters\\" \[\n {\n \\"payload\\" \\"flow greetings 88601\\",\n \\"type\\" \\"payload\\"\n }\n ],\n \\"sub type\\" \\"quick reply\\",\n \\"type\\" \\"button\\"\n }\n ],\n \\"namespace\\" \\"980c3243 2d2a 4d2d a572 b2a50552cb04\\",\n \\"name\\" \\"diwali offer\\",\n \\"language\\" {\n \\"code\\" \\"en us\\",\n \\"policy\\" \\"deterministic\\"\n }\n },\n \\"targetwhatsappnumber\\" \\"{{phone no}}\\"\n },\n \\"flowkey\\" null,\n \\"attributes\\" null\n }\n ]\n },\n \\"status\\" \\"scheduled\\"\n}'", "language" "curl", "customlabel" "broadcast wrapper api" } ], "selectedlanguageid" "sje6oda1qufydejy h0y5" }, "description" "", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } users api users api an api to fetch users who match the value specified for the attribute example to get list of users who have feedback with 1 star list of required parameters for this api call parameter description type attribute name the name of the attribute associated with the user string attribute value the value of the attribute associated with the user string conversations api conversations api an api to fetch a user conversation via user id example to store conversation data in crm parameters you can pass to filter the api response parameter description type userid \[path parameter] the user identifier retrieved from users list api string start date \[optional] start date (utc time in milliseconds), if blank, all records will be considered long end date \[optional] end date (utc time in milliseconds), if blank, the current utc time will be considered long page number \[optional] the number of pages for which the data should be displayed by default, the first page will be shown integer page size \[optional] total number of records to be shown in the api call, the default value is set to 500 integer whatsapp template broadcasting for template broadcasting to bulk users on whatsapp note only templates can be sent to users as per whatsapp policy beyond the time limts example apis broadcast api broadcast api to enable and use broadcast wrapper api please contact support\@moplet com for all channels including whatsapp with users within time limit for broadcast a simple text message or interactive messages to bulk users example marketing & advertisments, survey and promotion broadcast will be published based on the time mentioned in utc, immediate broadcasts will be sent for expired time multiple numbers in list format "channeluserids" \[ "9178921978038123","9190193486731" ] api trigger api trigger to trigger automations build on alertspanel platform for external usecases example sending an email to a customer who fills an external website form learn more about broadcasts in depth via api trigger document error scenarios error codes you might get while making the api call error codes description 400 error code 1002, error message invalid bot or customer id, error details the bot id/customer id/user id provided is invalid error code 1003, error message invalid input date value, error details the start date and end date values are the time in milliseconds and the end date should be greater than start date error code 1004, error message invalid page number, error details please enter the correct page number the page number in the api is a positive integer value starting with 1 401 unauthorized 403 forbidden 500 server side api failure