{"_id":"5829737a1392bb0f0072528f","user":"54eb4fdedf7add210007b29b","project":"54eb50e5615ffc1900305a16","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":27,"createdAt":"2015-02-23T17:30:32.501Z","releaseDate":"2015-02-23T17:30:32.501Z","categories":["54eb63b959b1172100334faf","54eb63b959b1172100334fb0","54eb63b959b1172100334fb1","54eb63b959b1172100334fb2","54ed8dd4ab373e2300f50eae","54ed99b2ab373e2300f50ede","55153a6de68daa2f00cff838","551546edbc466623002afe72","5515472ac28d6125001b8884","55154749c28d6125001b8885","555d9b4106dfec0d00d38ea7","5613e06e433e5735007c7708","5624bbb785a31117001c5403","56669e857cc81e0d00253f8e","568b8d837a42220d00498311","56a632277ef6620d00e2f18a","56d8147c3eb4dd0b00201aac","57a9ce2fac6db30e000d7efd","57a9cf4e944ea60e00dc3f74","58172386715dce0f00da4aa0","582dc59ee1b8692300c0dd03","589b19b4fec2730f0082e040","58b04a023529383900a759b5","58b92d1598157a0f004869bf","592e7685c58275000f20174f","59392839e376d4002f8a0474","59393064e376d4002f8a05a1","5947ae0d4005e2000f3a4fec","594a74df1d1de5001ab3517a","5954bc387a147f001b918915"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"__v":0,"parentDoc":null,"category":{"_id":"58172386715dce0f00da4aa0","project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-10-31T10:57:10.541Z","from_sync":false,"order":14,"slug":"facebook-messages","title":"Facebook messenger"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-14T08:19:06.857Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"Creating an application on Infobip's platform is the first step in order to use the Facebook messenger over Infobip API. Setup process starts with the application setup (on Facebook and Infobip platforms) and continues with the Configuration and Action setup (for receiving messages).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0be37f1-fb1.PNG\",\n        \"fb1.PNG\",\n        491,\n        87,\n        \"#dfd5d6\"\n      ],\n      \"caption\": \"Setup process\"\n    }\n  ]\n}\n[/block]\nOn this page, you will find the instructions on how to:\n* [Crate a new Infobip application over an API](#create-new-application)\n* [List all your applications over an API](#list-all-applications)\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Info\",\n  \"body\": \"After you finish with the application setup, you can continue with configuration and action setup.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"Create a new application\"\n}\n[/block]\nThis method allows you to create a new application\n\n```\nhttps://api.infobip.com/facebook/1/applications\n```\n\n##Body parameters\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|[facebook](#section-facebook-object)|object|-|Facebook object|\n\n#### Facebook object\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|[page](#section-page-object)|object|-|Facebook page object|\n|[application](#section-application-object)|object|-|Facebook application object|\n\n#### Page object\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|accessToken|string|-|Facebook page access token|\n\n#### Application object\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|id|int|-|Facebook application unique ID|\n|secret|string|-|Facebook application secret is used to verify that webhook events originate from Facebook.|\n\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /facebook/1/applications HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n  \\\"facebook\\\": {\\n    \\\"page\\\": {\\n        \\\"accessToken\\\": \\\"EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd...\\\"\\n    },\\n    \\\"application\\\": {\\n        \\\"id\\\": 1654219114885622,\\n        \\\"secret\\\": \\\"cf074b2e96390b3600031c751d9bf590\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n###Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"key\\\": \\\"0F3C3F29829FAB88714BA205BEC6D28F\\\",\\n  \\\"facebook\\\": {\\n    \\\"page\\\": {\\n        \\\"accessToken\\\": \\\"EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd...\\\"\\n    },\\n    \\\"application\\\": {\\n        \\\"id\\\": 1654219114885622,\\n        \\\"secret\\\": \\\"cf074b2e96390b3600031c751d9bf590\\\",\\n        \\\"name\\\": \\\"My application name\\\",\\n        \\\"imageUrl\\\": \\\"https://scontent.xx.fbcdn.net/t39...0696#_n.png\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n### Response format\nOn success, the response header HTTP status code will be `200 OK`. \nOn error, you will receive an [error response status code](/docs/response-codes#section-chat-error-codes). If you try to create an application without user’s authorization, you will receive a `401` Unauthorized error.\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|key|string|-|Infobip application key|\n|facebook|object|-|Facebook object|\n\n#### Facebook object\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|page|object|-|Facebook page object|\n|application|object|-|Facebook application object|\n\n#### Page object\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|accessToken|string|-|Facebook page access token|\n\n#### Application object\n\n|Parameter|Type|Default value|Description|\n|-|-|-|\n|id|int|-|Facebook application unique ID|\n|secret|string|-|Facebook application secret is used to verify that webhook events originate from Facebook.|\n|name|string|-|Facebook application name as it appears on Facebook platform|\n|imageUrl|string|-|Facebook application image url used as application icon|\n\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"List all applications\"\n}\n[/block]\nUse this method to retrieve all of your applications\n\n```\nhttps://api.infobip.com/facebook/1/applications\n```\n\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /facebook/1/applications HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n###Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"applications\\\": [\\n    {\\n      \\\"key\\\": \\\"0F3C3F29829FAB88714BA205BEC6D28F\\\",\\n      \\\"facebook\\\": {\\n        \\\"page\\\": {\\n          \\\"accessToken\\\": \\\"EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd...\\\"\\n        },\\n        \\\"application\\\": {\\n          \\\"id\\\": 1654219114885622,\\n          \\\"secret\\\": \\\"cf074b2e96390b3600031c751d9bf590\\\",\\n          \\\"name\\\": \\\"My application name\\\",\\n          \\\"imageUrl\\\": \\\"https://scontent.xx.fbcdn.net/t39...0696#_n.png\\n        }\\n      }\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nOn success, the response header HTTP status code will be `200 OK`. \nOn error, you will receive an [error response status code](/docs/response-codes#section-chat-error-codes). If you try to create an application without user’s authorization, you will receive a `401` Unauthorized error.","excerpt":"Manage Facebook application on Infobip platform","slug":"facebook-messenger-application","type":"basic","title":"Application"}

Application

Manage Facebook application on Infobip platform

Creating an application on Infobip's platform is the first step in order to use the Facebook messenger over Infobip API. Setup process starts with the application setup (on Facebook and Infobip platforms) and continues with the Configuration and Action setup (for receiving messages). [block:image] { "images": [ { "image": [ "https://files.readme.io/0be37f1-fb1.PNG", "fb1.PNG", 491, 87, "#dfd5d6" ], "caption": "Setup process" } ] } [/block] On this page, you will find the instructions on how to: * [Crate a new Infobip application over an API](#create-new-application) * [List all your applications over an API](#list-all-applications) [block:callout] { "type": "info", "title": "Info", "body": "After you finish with the application setup, you can continue with configuration and action setup." } [/block] [block:api-header] { "type": "post", "title": "Create a new application" } [/block] This method allows you to create a new application ``` https://api.infobip.com/facebook/1/applications ``` ##Body parameters |Parameter|Type|Default value|Description| |-|-|-| |[facebook](#section-facebook-object)|object|-|Facebook object| #### Facebook object |Parameter|Type|Default value|Description| |-|-|-| |[page](#section-page-object)|object|-|Facebook page object| |[application](#section-application-object)|object|-|Facebook application object| #### Page object |Parameter|Type|Default value|Description| |-|-|-| |accessToken|string|-|Facebook page access token| #### Application object |Parameter|Type|Default value|Description| |-|-|-| |id|int|-|Facebook application unique ID| |secret|string|-|Facebook application secret is used to verify that webhook events originate from Facebook.| ###Request example [block:code] { "codes": [ { "code": "POST /facebook/1/applications HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"facebook\": {\n \"page\": {\n \"accessToken\": \"EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd...\"\n },\n \"application\": {\n \"id\": 1654219114885622,\n \"secret\": \"cf074b2e96390b3600031c751d9bf590\"\n }\n }\n}", "language": "json" } ] } [/block] ###Response [block:code] { "codes": [ { "code": "{\n \"key\": \"0F3C3F29829FAB88714BA205BEC6D28F\",\n \"facebook\": {\n \"page\": {\n \"accessToken\": \"EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd...\"\n },\n \"application\": {\n \"id\": 1654219114885622,\n \"secret\": \"cf074b2e96390b3600031c751d9bf590\",\n \"name\": \"My application name\",\n \"imageUrl\": \"https://scontent.xx.fbcdn.net/t39...0696#_n.png\"\n }\n }\n}", "language": "json" } ] } [/block] ### Response format On success, the response header HTTP status code will be `200 OK`. On error, you will receive an [error response status code](/docs/response-codes#section-chat-error-codes). If you try to create an application without user’s authorization, you will receive a `401` Unauthorized error. |Parameter|Type|Default value|Description| |-|-|-| |key|string|-|Infobip application key| |facebook|object|-|Facebook object| #### Facebook object |Parameter|Type|Default value|Description| |-|-|-| |page|object|-|Facebook page object| |application|object|-|Facebook application object| #### Page object |Parameter|Type|Default value|Description| |-|-|-| |accessToken|string|-|Facebook page access token| #### Application object |Parameter|Type|Default value|Description| |-|-|-| |id|int|-|Facebook application unique ID| |secret|string|-|Facebook application secret is used to verify that webhook events originate from Facebook.| |name|string|-|Facebook application name as it appears on Facebook platform| |imageUrl|string|-|Facebook application image url used as application icon| [block:api-header] { "type": "get", "title": "List all applications" } [/block] Use this method to retrieve all of your applications ``` https://api.infobip.com/facebook/1/applications ``` ###Request example [block:code] { "codes": [ { "code": "GET /facebook/1/applications HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", "language": "json" } ] } [/block] ###Response [block:code] { "codes": [ { "code": "{\n \"applications\": [\n {\n \"key\": \"0F3C3F29829FAB88714BA205BEC6D28F\",\n \"facebook\": {\n \"page\": {\n \"accessToken\": \"EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd...\"\n },\n \"application\": {\n \"id\": 1654219114885622,\n \"secret\": \"cf074b2e96390b3600031c751d9bf590\",\n \"name\": \"My application name\",\n \"imageUrl\": \"https://scontent.xx.fbcdn.net/t39...0696#_n.png\n }\n }\n }\n ]\n}", "language": "json" } ] } [/block] On success, the response header HTTP status code will be `200 OK`. On error, you will receive an [error response status code](/docs/response-codes#section-chat-error-codes). If you try to create an application without user’s authorization, you will receive a `401` Unauthorized error.