{"__v":15,"_id":"559199e5284de319008354e2","category":{"__v":4,"_id":"559199695631432f002d358a","pages":["559199e5284de319008354e2","55a8d33ecf45e1390093f1b6","55a8d458cf45e1390093f1bd","55d76474d2a8eb190010a010"],"project":"552829408962f339009a678d","version":"552829408962f339009a6790","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-29T19:15:53.326Z","from_sync":false,"order":2,"slug":"integrations","title":"Integrations"},"parentDoc":null,"project":"552829408962f339009a678d","user":"55282916d9e1db2d00cd923c","version":{"__v":26,"_id":"552829408962f339009a6790","project":"552829408962f339009a678d","createdAt":"2015-04-10T19:49:20.516Z","releaseDate":"2015-04-10T19:49:20.516Z","categories":["552829418962f339009a6791","55284ed68962f339009a67e1","55286c73391a362500d9b3f4","552918f6b316811900149f59","5529b255d739240d00a3483e","553287590a578a0d008d4ff5","55329385e7d1fa0d003fc946","5550b55200420e0d00d1312f","55525fca953c9c0d00f507d7","559199695631432f002d358a","559d8d96980b801700d5ec7e","55c5e833cccdeb2d004e24b9","55d76504f662951900fc0e7d","55ea213cc62aa02f008229cd","56157b750f5ed00d00483dd8","561981fbac0924170069f4e8","561b8b1ea430930d0037ea67","563417428b86331700b488ca","56cd785bface161300dae0ec","56cdcc6e70db8a15006395f4","56cdf1b749abf10b0036a34a","56cedc8ce50c9c1b00830423","56e97ba8d825061900d1ac83","570d505228e6900e00477229","573614ca2ab52e1700c8e851","57d556a2496a3117004d70cf"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["5765fd4cf145bb0e0075fa89"],"next":{"pages":[],"description":""},"createdAt":"2015-06-29T19:17:57.286Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Actor has a simple interface for sending and receiving messages in groups.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Sending messages\"\n}\n[/block]\nIn a group information, you can get integration token to send text messages to chat.\nSending messages is very simple you only need to make POST HTTP request to this URL with JSON:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"text\\\": \\\"Wow! Hello guys! I am bot!\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIf you want to give it a try in the simplest manner as possible, try using curl command, like this:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -H \\\"Content-Type: application/json\\\" -X POST -d '{ \\\"text\\\": \\\"Wow! Hello guys! I am bot!\\\" }' https://api.actor.im/v1/webhooks/dfc2d6585a17b3ab9709b7eab0d468709e494bced257934d8aae7bb20b756b8\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Receiving messages\"\n}\n[/block]\nActor provides reverse webhooks to make possible integration with external systems. Reverse hooks are available in group conversations. You can register multiple hooks for one group. You have to use group's integration token in order to create, remove and inspect reverse hooks.\n\nYou can manipulate reverse hooks in following ways:\n\n* Register new webhook for given token:\n      POST https://api.actor.im/v1/webhooks/<token>/reverse \n      Body: { \"url\": \"http://example.com/logger\" }\n      Responses: \n        Created(201): {\"id\": 12345} - Webhook successfuly registered with id 12345\n        NotFound(404): {\"message\": \"Wrong integration token\"}\n        Conflict(409): {\"message\": \"Webhooks with provided uri is already registered\"}\nAfter you register webhook, Actor will start to forward all messages sent to the group to the URL you provided.\n\n* Check status of given webhook by token and hook's id:\n      GET https://api.actor.im/v1/webhooks/<token>/reverse/<hook id>\n      Responses:\n        Ok(200): {\"status\": \"Ok\"} - Webhook with given id is active\n        Gone(410): {\"status\": \"Webhook with given id not found\"}\n\n* Get list of webhooks by given token:\n      GET https://api.actor.im/v1/webhooks/<token>/reverse\n      Response: \n        Ok(200): [{\"id\": 12345, \"url\":\"http://example.com/logger\"}, {\"id\": 6789, \"url\":\"http://example.com/watcher\"}]\n\n* Unregister hook by token and hook's id:\n       DELETE https://api.actor.im/v1/webhooks/<token>/reverse/<hook id>\n       Responses: \n        Accepted(202): {\"status\": \"Ok\"}\n        Gone(410): {\"status\": \"Webhook with given id not found\"}","excerpt":"Integration token for groups","slug":"simple-integration","type":"basic","title":"Web Hooks"}

Web Hooks

Integration token for groups

Actor has a simple interface for sending and receiving messages in groups. [block:api-header] { "type": "basic", "title": "Sending messages" } [/block] In a group information, you can get integration token to send text messages to chat. Sending messages is very simple you only need to make POST HTTP request to this URL with JSON: [block:code] { "codes": [ { "code": "{\n \"text\": \"Wow! Hello guys! I am bot!\"\n}", "language": "json" } ] } [/block] If you want to give it a try in the simplest manner as possible, try using curl command, like this: [block:code] { "codes": [ { "code": "curl -H \"Content-Type: application/json\" -X POST -d '{ \"text\": \"Wow! Hello guys! I am bot!\" }' https://api.actor.im/v1/webhooks/dfc2d6585a17b3ab9709b7eab0d468709e494bced257934d8aae7bb20b756b8", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic", "title": "Receiving messages" } [/block] Actor provides reverse webhooks to make possible integration with external systems. Reverse hooks are available in group conversations. You can register multiple hooks for one group. You have to use group's integration token in order to create, remove and inspect reverse hooks. You can manipulate reverse hooks in following ways: * Register new webhook for given token: POST https://api.actor.im/v1/webhooks/<token>/reverse Body: { "url": "http://example.com/logger" } Responses: Created(201): {"id": 12345} - Webhook successfuly registered with id 12345 NotFound(404): {"message": "Wrong integration token"} Conflict(409): {"message": "Webhooks with provided uri is already registered"} After you register webhook, Actor will start to forward all messages sent to the group to the URL you provided. * Check status of given webhook by token and hook's id: GET https://api.actor.im/v1/webhooks/<token>/reverse/<hook id> Responses: Ok(200): {"status": "Ok"} - Webhook with given id is active Gone(410): {"status": "Webhook with given id not found"} * Get list of webhooks by given token: GET https://api.actor.im/v1/webhooks/<token>/reverse Response: Ok(200): [{"id": 12345, "url":"http://example.com/logger"}, {"id": 6789, "url":"http://example.com/watcher"}] * Unregister hook by token and hook's id: DELETE https://api.actor.im/v1/webhooks/<token>/reverse/<hook id> Responses: Accepted(202): {"status": "Ok"} Gone(410): {"status": "Webhook with given id not found"}