{"_id":"587f5ef286f7841b0075a2b8","user":"582ddb2f8653af2d00f5a9c5","parentDoc":null,"version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":28,"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","59b8eeeb707542001076d3b6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"project":"54eb50e5615ffc1900305a16","__v":0,"category":{"_id":"582dc59ee1b8692300c0dd03","__v":0,"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-11-17T14:58:38.431Z","from_sync":false,"order":17,"slug":"line","title":"LINE messaging"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-18T12:26:26.338Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"**Line messaging API** connects your CRM software, website or an application to the Line's messaging platform.\n\nIt enables direct communication with your customers on Line using the same platform that they already use when talking to their friends. It allows you to personally interact with them, keep them engaged with your business, and drive them to perform actions. The messages can be personal, informative, transactional, or promotional, and support text, images, buttons, and links.\n\nLine API can be used with both Line:::at::: account and Line Official account.\nFor opening a LINE Official account you need to submit a [partnership proposal](https://partner.line.me/en/partner/join) to LINE.\nFor opening LINE@ account follow the instructions below.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"LINE@ account\"\n}\n[/block]\n**LINE@ account ** will enable you to interact more closely with your user.\n\nBy using the Infobip API you can integrate your own solution for receiving and sending messages to your users by using two simple API methods:\n  * [Send message](/docs/send-single-line-message-api)\n  * [Receive message](/docs/receive-line-message-api)\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Initial setup\",\n  \"body\": \"In order to start using an API for messaging you have to go through the initial setup which consists of:\\n1.[Signup for using LINE](#signup-for-using-line)\\n2.[Create a LINE@ account](#create-a-line-account)\\n3.[Enable messaging API](#enable-the-messaging-api)\\n4.[Configure your channel](#configure-your-channel)\\n5.[Create the application on Infobip's platform](#create-the-application-on-infobips-platform) and connecting it to the LINE@ account\\n6.[Configure LINE webhook](#configure-your-webhook)\\n7.[Setting up the configuration options for incoming messages](#configuration-process-for-receiving-messages)\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Signup for using LINE\"\n}\n[/block]\n1. Download the LINE app and perform a signup\n2. Add an email inside the LINE app by going to Settings>Account>Email registration.\n3. With email and password added in the previous step go to [LINE Business Center](https://business.line.me/en/)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Create a LINE@ account\"\n}\n[/block]\n1. In the [LINE Business Center](https://business.line.me/en/), select** Messaging API** under the “Service” category at the top of the page.\n2. Select either **Start using Messaging API** or **Start Developer Trial**.\n3. Create the enterprise who will be the owner of your account or select the existing one.\n3. Enter the required information (account name, business type) for your new LINE@ account. Confirm the information.\n4. You can see all your accounts by clicking on Account list button.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Enable the Messaging API\"\n}\n[/block]\n1. Go to your LINE@ account page in the [LINE Business Center](https://business.line.me/en/)\n2. You can see all you accounts under \"Accounts\" category at the top of the page.\n3. Click the **LINE@ MANAGER** button for your account\n4. Go to  to the \"Settings\" > “Bot Settings” page of the LINE@ Manager.\n5. On the “Bot Settings” page, click **Enable API**.\n6. To use the reply message API, select Allow for “Use webhooks” under “Request Settings”\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configure your channel\"\n}\n[/block]\n1. Go to your LINE@ account page in the [LINE Business Center](https://business.line.me/en/).\n2. You can see all you accounts under the \"Accounts\" category at the top of the page.\n3. Click the **LINE Developers** button for your account\n4. Go to Basic information > Channel Access Token at the bottom of the page\n5. To issue the \"Channel Access Token\" for accessing APIs, click** ISSUE** for the “Channel Access Token” item.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Channel Access Token\",\n  \"body\": \"Copy and save your **Channel Access Token** somewhere convenient as you will need it in next steps.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Create the application on Infobip's platform\"\n}\n[/block]\nBefore continuing to set up webhooks, you have to** create the application on Infobip platform** which must be associated with this Line channel. \n\nA new application can be created with the single API call. Use **Channel Access Token** from the previous step as a value of `accessToken` parameter.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Infobip application\",\n  \"body\": \"You can access your previously created application through other API calls described [here](/docs/line-chat-application#list-all-applications).\"\n}\n[/block]\nCreate an Infobip application - request example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /line/1/applications HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n  \\\"line\\\": {\\n    \\\"channel\\\": {\\n      \\\"accessToken\\\":\\\"...\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nResponse\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"key\\\": \\\"8F0792F86035A9F4290821F1EE6BC06A\\\",\\n  \\\"line\\\": {\\n    \\\"channel\\\": {\\n      \\\"id\\\": 1234,\\n      \\\"accessToken\\\": \\\"...\\\",\\n      \\\"name\\\": \\\"Line Channel Name\\\",\\n      \\\"imageUrl\\\": \\\"Line Channel Image Url\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nResponse will contain supplied `accessToken` and `key` values.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Infobip application key\",\n  \"body\": \"Copy and save your `key` as you will need it in the next steps. You will use the same `key` later when sending messages. The `key` can always be retrieved by calling the ['List all applications'](/docs/line-chat-application#list-all-applications) method.\"\n}\n[/block]\nYou are now ready to continue with the configuration of the LINE webhook.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configure your webhook\"\n}\n[/block]\n1. Go to your LINE@ account page in the [LINE Business Center](https://business.line.me/en/).\n2. You can see all you accounts under \"Accounts\" category at the top of the page.\n3. Click the **LINE Developers** button for your account\n3. Under Basic information click EDIT and set a webhook URL for your Channel: `https://api.infobip.com/omnichat/1/accounts/{accountKey}/applications/{applicationKey}/integrations/line/webhook`, replacing the placeholder {applicationKey} with the value previously obtained from Infobip.\nTo get accountKey use [Account: Get](doc:account-get).\n\n**That's it!** You are now ready to send test messages over an API by performing a ['Send message API' method](/docs/send-single-line-message-api). Before you can receive inbound messages you need to go through the [Configuration process for receiving messages](#configuration-process-for-receiving-messages).\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configuration process for receiving messages\"\n}\n[/block]\nYou have successfully configured **message sending**, and now it's time to configure **message receiving** options:\n\n###Incoming message setup steps\n1. [**Configuration**](/docs/line-chat-configuration) represents a container for a set of different Actions.\n2. [**Action**](/docs/line-chat-action) represents collection of methods used to trigger different HTTP actions. Through the 'Action configuration' you can define how would you like to receive incoming messages - by Pull or Forward method.","excerpt":"","slug":"introduction-and-setup","type":"basic","title":"introduction and setup"}

introduction and setup


**Line messaging API** connects your CRM software, website or an application to the Line's messaging platform. It enables direct communication with your customers on Line using the same platform that they already use when talking to their friends. It allows you to personally interact with them, keep them engaged with your business, and drive them to perform actions. The messages can be personal, informative, transactional, or promotional, and support text, images, buttons, and links. Line API can be used with both Line@ account and Line Official account. For opening a LINE Official account you need to submit a [partnership proposal](https://partner.line.me/en/partner/join) to LINE. For opening LINE@ account follow the instructions below. [block:api-header] { "type": "basic", "title": "LINE@ account" } [/block] **LINE@ account ** will enable you to interact more closely with your user. By using the Infobip API you can integrate your own solution for receiving and sending messages to your users by using two simple API methods: * [Send message](/docs/send-single-line-message-api) * [Receive message](/docs/receive-line-message-api) [block:callout] { "type": "warning", "title": "Initial setup", "body": "In order to start using an API for messaging you have to go through the initial setup which consists of:\n1.[Signup for using LINE](#signup-for-using-line)\n2.[Create a LINE@ account](#create-a-line-account)\n3.[Enable messaging API](#enable-the-messaging-api)\n4.[Configure your channel](#configure-your-channel)\n5.[Create the application on Infobip's platform](#create-the-application-on-infobips-platform) and connecting it to the LINE@ account\n6.[Configure LINE webhook](#configure-your-webhook)\n7.[Setting up the configuration options for incoming messages](#configuration-process-for-receiving-messages)" } [/block] [block:api-header] { "type": "basic", "title": "Signup for using LINE" } [/block] 1. Download the LINE app and perform a signup 2. Add an email inside the LINE app by going to Settings>Account>Email registration. 3. With email and password added in the previous step go to [LINE Business Center](https://business.line.me/en/) [block:api-header] { "type": "basic", "title": "Create a LINE@ account" } [/block] 1. In the [LINE Business Center](https://business.line.me/en/), select** Messaging API** under the “Service” category at the top of the page. 2. Select either **Start using Messaging API** or **Start Developer Trial**. 3. Create the enterprise who will be the owner of your account or select the existing one. 3. Enter the required information (account name, business type) for your new LINE@ account. Confirm the information. 4. You can see all your accounts by clicking on Account list button. [block:api-header] { "type": "basic", "title": "Enable the Messaging API" } [/block] 1. Go to your LINE@ account page in the [LINE Business Center](https://business.line.me/en/) 2. You can see all you accounts under "Accounts" category at the top of the page. 3. Click the **LINE@ MANAGER** button for your account 4. Go to to the "Settings" > “Bot Settings” page of the LINE@ Manager. 5. On the “Bot Settings” page, click **Enable API**. 6. To use the reply message API, select Allow for “Use webhooks” under “Request Settings” [block:api-header] { "type": "basic", "title": "Configure your channel" } [/block] 1. Go to your LINE@ account page in the [LINE Business Center](https://business.line.me/en/). 2. You can see all you accounts under the "Accounts" category at the top of the page. 3. Click the **LINE Developers** button for your account 4. Go to Basic information > Channel Access Token at the bottom of the page 5. To issue the "Channel Access Token" for accessing APIs, click** ISSUE** for the “Channel Access Token” item. [block:callout] { "type": "warning", "title": "Channel Access Token", "body": "Copy and save your **Channel Access Token** somewhere convenient as you will need it in next steps." } [/block] [block:api-header] { "type": "basic", "title": "Create the application on Infobip's platform" } [/block] Before continuing to set up webhooks, you have to** create the application on Infobip platform** which must be associated with this Line channel. A new application can be created with the single API call. Use **Channel Access Token** from the previous step as a value of `accessToken` parameter. [block:callout] { "type": "info", "title": "Infobip application", "body": "You can access your previously created application through other API calls described [here](/docs/line-chat-application#list-all-applications)." } [/block] Create an Infobip application - request example: [block:code] { "codes": [ { "code": "POST /line/1/applications HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"line\": {\n \"channel\": {\n \"accessToken\":\"...\"\n }\n }\n}", "language": "json" } ] } [/block] Response [block:code] { "codes": [ { "code": "{\n \"key\": \"8F0792F86035A9F4290821F1EE6BC06A\",\n \"line\": {\n \"channel\": {\n \"id\": 1234,\n \"accessToken\": \"...\",\n \"name\": \"Line Channel Name\",\n \"imageUrl\": \"Line Channel Image Url\"\n }\n }\n}", "language": "json" } ] } [/block] Response will contain supplied `accessToken` and `key` values. [block:callout] { "type": "warning", "title": "Infobip application key", "body": "Copy and save your `key` as you will need it in the next steps. You will use the same `key` later when sending messages. The `key` can always be retrieved by calling the ['List all applications'](/docs/line-chat-application#list-all-applications) method." } [/block] You are now ready to continue with the configuration of the LINE webhook. [block:api-header] { "type": "basic", "title": "Configure your webhook" } [/block] 1. Go to your LINE@ account page in the [LINE Business Center](https://business.line.me/en/). 2. You can see all you accounts under "Accounts" category at the top of the page. 3. Click the **LINE Developers** button for your account 3. Under Basic information click EDIT and set a webhook URL for your Channel: `https://api.infobip.com/omnichat/1/accounts/{accountKey}/applications/{applicationKey}/integrations/line/webhook`, replacing the placeholder {applicationKey} with the value previously obtained from Infobip. To get accountKey use [Account: Get](doc:account-get). **That's it!** You are now ready to send test messages over an API by performing a ['Send message API' method](/docs/send-single-line-message-api). Before you can receive inbound messages you need to go through the [Configuration process for receiving messages](#configuration-process-for-receiving-messages). [block:api-header] { "type": "basic", "title": "Configuration process for receiving messages" } [/block] You have successfully configured **message sending**, and now it's time to configure **message receiving** options: ###Incoming message setup steps 1. [**Configuration**](/docs/line-chat-configuration) represents a container for a set of different Actions. 2. [**Action**](/docs/line-chat-action) represents collection of methods used to trigger different HTTP actions. Through the 'Action configuration' you can define how would you like to receive incoming messages - by Pull or Forward method.