├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── question.md ├── actions │ └── post-comment-action │ │ ├── action.yml │ │ ├── main.js │ │ ├── package-lock.json │ │ └── package.json └── workflows │ ├── ci.yml │ ├── close-issue.yml │ ├── label-issue.yml │ ├── sdk-testing.yml │ └── warn-pr-from-forked-repository.yml ├── .gitignore ├── .spectral.yaml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── channel-access-token.yml ├── insight.yml ├── liff.yml ├── manage-audience.yml ├── messaging-api.yml ├── module-attach.yml ├── module.yml ├── package-lock.json ├── package.json ├── renovate.json5 ├── shop.yml ├── tools ├── determine-change-type.mjs ├── generate-test.mjs ├── get-pr-info.mjs ├── reformat.mjs ├── validate-all.mjs ├── validate-inheritance.mjs ├── validate-property-camelcase.mjs └── validate-request-suffix.mjs └── webhook.yml /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report Template 3 | about: Use this template to report bugs in the line-openapi 4 | title: 'Bug Report' 5 | --- 6 | 7 | 14 | 15 | ## System Information 16 | - OS: [e.g. Ubuntu] 17 | - line-openapi version(s) [e.g. 2.6.1] 18 | 19 | ## Expected Behavior 20 | 21 | 22 | ## Current Behavior 23 | 24 | 25 | ## Steps to Reproduce 26 | 28 | 1. 29 | 2. 30 | 3. 31 | 32 | ## Logs 33 | 34 | 35 | ## Additional Context (Optional) 36 | 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "Feature Request" 5 | --- 6 | 7 | ## Feature Request 8 | 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Question Template" 3 | about: "Use this template to ask questions about usage or implementation of the line-openapi." 4 | title: "Question" 5 | --- 6 | 7 | 18 | 19 | ## Have You Checked the Following? 20 | - [ ] [Developer Documentation - LINE Developers](https://developers.line.biz/en/docs/) 21 | - [ ] [FAQ - LINE Developers](https://developers.line.biz/en/faq/tags/messaging-api/) 22 | 23 | ## Summary of Your Question 24 | 25 | 26 | ## Details 27 | 28 | 29 | ## What You've Tried 30 | 32 | 33 | ## Your Environment 34 | 38 | 39 | ## Additional Context (Optional) 40 | 41 | -------------------------------------------------------------------------------- /.github/actions/post-comment-action/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Post and Manage PR Comments' 2 | description: 'Posts comments to PR and deletes previous ones for the same job' 3 | inputs: 4 | language: 5 | description: 'The language of the SDK' 6 | required: true 7 | github-token: 8 | description: 'The GitHub token' 9 | required: true 10 | 11 | outputs: {} 12 | 13 | runs: 14 | using: 'composite' 15 | steps: 16 | - name: check current directory 17 | run: pwd 18 | shell: bash 19 | - name: Install dependencies 20 | run: npm ci 21 | shell: bash 22 | working-directory: ${{ github.action_path }} 23 | 24 | - name: Post PR comment 25 | run: node ${{ github.action_path }}/main.js 26 | shell: bash 27 | env: 28 | LANGUAGE: ${{ inputs.language }} 29 | GITHUB_TOKEN: ${{ inputs.github-token }} 30 | -------------------------------------------------------------------------------- /.github/actions/post-comment-action/main.js: -------------------------------------------------------------------------------- 1 | const github = require('@actions/github'); 2 | const core = require('@actions/core'); 3 | 4 | async function run() { 5 | try { 6 | const token = process.env.GITHUB_TOKEN; 7 | const language = process.env.LANGUAGE; 8 | 9 | const octokit = github.getOctokit(token); 10 | const context = github.context; 11 | 12 | const stepName = 'Show diff' 13 | 14 | const prNumber = context.payload.pull_request.number; 15 | const runId = context.runId; 16 | const jobName = context.job; 17 | 18 | // Delete the previous comment if it exists 19 | const { data: comments } = await octokit.rest.issues.listComments({ 20 | owner: context.repo.owner, 21 | repo: context.repo.repo, 22 | issue_number: prNumber, 23 | }); 24 | 25 | const medadataForComment = ``; 26 | 27 | for (const comment of comments) { 28 | if ( 29 | comment.user.login === 'github-actions[bot]' && 30 | comment.body.includes(medadataForComment) 31 | ) { 32 | await octokit.rest.issues.deleteComment({ 33 | owner: context.repo.owner, 34 | repo: context.repo.repo, 35 | comment_id: comment.id, 36 | }); 37 | } 38 | } 39 | 40 | // Post the new comment 41 | const { data: { jobs } } = await octokit.rest.actions.listJobsForWorkflowRun({ 42 | owner: context.repo.owner, 43 | repo: context.repo.repo, 44 | run_id: runId, 45 | }); 46 | 47 | const currentJob = jobs.find(job => job.name === jobName); 48 | if (!currentJob) { 49 | throw new Error(`Job ${jobName} not found`); 50 | } 51 | 52 | const jobId = currentJob.id; 53 | 54 | const step = currentJob.steps.find(step => step.name === stepName); 55 | if (!step) { 56 | throw new Error(`Step '${stepName}' not found`); 57 | } 58 | 59 | const stepNumber = currentJob.steps.indexOf(step) + 1; 60 | 61 | const url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}/job/${jobId}?pr=${prNumber}#step:${stepNumber}:1`; 62 | 63 | // Create comment as markdown 64 | let fullCommentBody = `## ${language.toUpperCase()} \n` + 65 | `You can check generated code in ${language}\n\n` + 66 | `[Check the diff here](${url})`; 67 | 68 | await octokit.rest.issues.createComment({ 69 | owner: context.repo.owner, 70 | repo: context.repo.repo, 71 | issue_number: prNumber, 72 | body: `${medadataForComment}\n${fullCommentBody}`, 73 | }); 74 | } catch (error) { 75 | console.error(error); 76 | core.setFailed(`Error in this script: ${error.message}`); 77 | } 78 | } 79 | 80 | run(); 81 | -------------------------------------------------------------------------------- /.github/actions/post-comment-action/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "post-comment-action", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "post-comment-action", 9 | "version": "1.0.0", 10 | "dependencies": { 11 | "@actions/core": "^1.2.4", 12 | "@actions/github": "^4.0.0" 13 | } 14 | }, 15 | "node_modules/@actions/core": { 16 | "version": "1.11.1", 17 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", 18 | "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", 19 | "dependencies": { 20 | "@actions/exec": "^1.1.1", 21 | "@actions/http-client": "^2.0.1" 22 | } 23 | }, 24 | "node_modules/@actions/exec": { 25 | "version": "1.1.1", 26 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", 27 | "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", 28 | "dependencies": { 29 | "@actions/io": "^1.0.1" 30 | } 31 | }, 32 | "node_modules/@actions/github": { 33 | "version": "4.0.0", 34 | "resolved": "https://registry.npmjs.org/@actions/github/-/github-4.0.0.tgz", 35 | "integrity": "sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==", 36 | "dependencies": { 37 | "@actions/http-client": "^1.0.8", 38 | "@octokit/core": "^3.0.0", 39 | "@octokit/plugin-paginate-rest": "^2.2.3", 40 | "@octokit/plugin-rest-endpoint-methods": "^4.0.0" 41 | } 42 | }, 43 | "node_modules/@actions/github/node_modules/@actions/http-client": { 44 | "version": "1.0.11", 45 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", 46 | "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", 47 | "dependencies": { 48 | "tunnel": "0.0.6" 49 | } 50 | }, 51 | "node_modules/@actions/http-client": { 52 | "version": "2.2.3", 53 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", 54 | "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", 55 | "dependencies": { 56 | "tunnel": "^0.0.6", 57 | "undici": "^5.25.4" 58 | } 59 | }, 60 | "node_modules/@actions/io": { 61 | "version": "1.1.3", 62 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", 63 | "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" 64 | }, 65 | "node_modules/@fastify/busboy": { 66 | "version": "2.1.1", 67 | "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", 68 | "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", 69 | "engines": { 70 | "node": ">=14" 71 | } 72 | }, 73 | "node_modules/@octokit/auth-token": { 74 | "version": "2.5.0", 75 | "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", 76 | "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", 77 | "dependencies": { 78 | "@octokit/types": "^6.0.3" 79 | } 80 | }, 81 | "node_modules/@octokit/core": { 82 | "version": "3.6.0", 83 | "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", 84 | "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", 85 | "dependencies": { 86 | "@octokit/auth-token": "^2.4.4", 87 | "@octokit/graphql": "^4.5.8", 88 | "@octokit/request": "^5.6.3", 89 | "@octokit/request-error": "^2.0.5", 90 | "@octokit/types": "^6.0.3", 91 | "before-after-hook": "^2.2.0", 92 | "universal-user-agent": "^6.0.0" 93 | } 94 | }, 95 | "node_modules/@octokit/endpoint": { 96 | "version": "6.0.12", 97 | "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", 98 | "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", 99 | "dependencies": { 100 | "@octokit/types": "^6.0.3", 101 | "is-plain-object": "^5.0.0", 102 | "universal-user-agent": "^6.0.0" 103 | } 104 | }, 105 | "node_modules/@octokit/graphql": { 106 | "version": "4.8.0", 107 | "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", 108 | "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", 109 | "dependencies": { 110 | "@octokit/request": "^5.6.0", 111 | "@octokit/types": "^6.0.3", 112 | "universal-user-agent": "^6.0.0" 113 | } 114 | }, 115 | "node_modules/@octokit/openapi-types": { 116 | "version": "12.11.0", 117 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", 118 | "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" 119 | }, 120 | "node_modules/@octokit/plugin-paginate-rest": { 121 | "version": "2.21.3", 122 | "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz", 123 | "integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==", 124 | "dependencies": { 125 | "@octokit/types": "^6.40.0" 126 | }, 127 | "peerDependencies": { 128 | "@octokit/core": ">=2" 129 | } 130 | }, 131 | "node_modules/@octokit/plugin-rest-endpoint-methods": { 132 | "version": "4.15.1", 133 | "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.15.1.tgz", 134 | "integrity": "sha512-4gQg4ySoW7ktKB0Mf38fHzcSffVZd6mT5deJQtpqkuPuAqzlED5AJTeW8Uk7dPRn7KaOlWcXB0MedTFJU1j4qA==", 135 | "dependencies": { 136 | "@octokit/types": "^6.13.0", 137 | "deprecation": "^2.3.1" 138 | }, 139 | "peerDependencies": { 140 | "@octokit/core": ">=3" 141 | } 142 | }, 143 | "node_modules/@octokit/request": { 144 | "version": "5.6.3", 145 | "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", 146 | "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", 147 | "dependencies": { 148 | "@octokit/endpoint": "^6.0.1", 149 | "@octokit/request-error": "^2.1.0", 150 | "@octokit/types": "^6.16.1", 151 | "is-plain-object": "^5.0.0", 152 | "node-fetch": "^2.6.7", 153 | "universal-user-agent": "^6.0.0" 154 | } 155 | }, 156 | "node_modules/@octokit/request-error": { 157 | "version": "2.1.0", 158 | "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", 159 | "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", 160 | "dependencies": { 161 | "@octokit/types": "^6.0.3", 162 | "deprecation": "^2.0.0", 163 | "once": "^1.4.0" 164 | } 165 | }, 166 | "node_modules/@octokit/types": { 167 | "version": "6.41.0", 168 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", 169 | "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", 170 | "dependencies": { 171 | "@octokit/openapi-types": "^12.11.0" 172 | } 173 | }, 174 | "node_modules/before-after-hook": { 175 | "version": "2.2.3", 176 | "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", 177 | "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" 178 | }, 179 | "node_modules/deprecation": { 180 | "version": "2.3.1", 181 | "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", 182 | "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" 183 | }, 184 | "node_modules/is-plain-object": { 185 | "version": "5.0.0", 186 | "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", 187 | "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", 188 | "engines": { 189 | "node": ">=0.10.0" 190 | } 191 | }, 192 | "node_modules/node-fetch": { 193 | "version": "2.7.0", 194 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", 195 | "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", 196 | "dependencies": { 197 | "whatwg-url": "^5.0.0" 198 | }, 199 | "engines": { 200 | "node": "4.x || >=6.0.0" 201 | }, 202 | "peerDependencies": { 203 | "encoding": "^0.1.0" 204 | }, 205 | "peerDependenciesMeta": { 206 | "encoding": { 207 | "optional": true 208 | } 209 | } 210 | }, 211 | "node_modules/once": { 212 | "version": "1.4.0", 213 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 214 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 215 | "dependencies": { 216 | "wrappy": "1" 217 | } 218 | }, 219 | "node_modules/tr46": { 220 | "version": "0.0.3", 221 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 222 | "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" 223 | }, 224 | "node_modules/tunnel": { 225 | "version": "0.0.6", 226 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 227 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 228 | "engines": { 229 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 230 | } 231 | }, 232 | "node_modules/undici": { 233 | "version": "5.28.4", 234 | "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", 235 | "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", 236 | "dependencies": { 237 | "@fastify/busboy": "^2.0.0" 238 | }, 239 | "engines": { 240 | "node": ">=14.0" 241 | } 242 | }, 243 | "node_modules/universal-user-agent": { 244 | "version": "6.0.1", 245 | "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", 246 | "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" 247 | }, 248 | "node_modules/webidl-conversions": { 249 | "version": "3.0.1", 250 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 251 | "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" 252 | }, 253 | "node_modules/whatwg-url": { 254 | "version": "5.0.0", 255 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 256 | "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", 257 | "dependencies": { 258 | "tr46": "~0.0.3", 259 | "webidl-conversions": "^3.0.0" 260 | } 261 | }, 262 | "node_modules/wrappy": { 263 | "version": "1.0.2", 264 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 265 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 266 | } 267 | } 268 | } 269 | -------------------------------------------------------------------------------- /.github/actions/post-comment-action/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "post-comment-action", 3 | "version": "1.0.0", 4 | "description": "Post comments on a pull request", 5 | "main": "main.js", 6 | "dependencies": { 7 | "@actions/core": "^1.2.4", 8 | "@actions/github": "^4.0.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Basic CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | merge_group: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | setup: 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: read 14 | steps: 15 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 16 | - name: Use Node.js 17 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 18 | with: 19 | cache: 'npm' 20 | - run: npm install -g @stoplight/spectral-cli 21 | - run: npm install . 22 | - run: npx zx ./tools/validate-all.mjs 23 | - run: npx zx ./tools/validate-request-suffix.mjs 24 | - run: npx zx ./tools/validate-inheritance.mjs 25 | 26 | generate-test: 27 | runs-on: ubuntu-latest 28 | permissions: 29 | contents: read 30 | steps: 31 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 32 | - name: Use Node.js 33 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 34 | with: 35 | cache: 'npm' 36 | - run: npm install -g @openapitools/openapi-generator-cli 37 | - run: openapi-generator-cli version-manager set 7.0.1 38 | - run: sed -i -e 's/openapi-generator/openapi-generator-cli/g' ./tools/generate-test.mjs 39 | - name: actions/setup-java@v3 (JDK 17) 40 | uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 41 | with: 42 | distribution: 'temurin' 43 | java-version: 17 44 | architecture: x64 45 | - run: npx zx ./tools/generate-test.mjs 46 | 47 | format-diff: 48 | runs-on: ubuntu-latest 49 | permissions: 50 | contents: read 51 | steps: 52 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 53 | - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 54 | with: 55 | cache: 'npm' 56 | - run: npx zx ./tools/reformat.mjs 57 | - name: Check there is no diff (Run ./tools/reformat.mjs if there is a diff) 58 | run: git diff --exit-code 59 | 60 | property-should-be-camelcase: 61 | runs-on: ubuntu-latest 62 | permissions: 63 | contents: read 64 | steps: 65 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 66 | with: 67 | # ensures origin/main is available for git show 68 | fetch-depth: 0 69 | - name: Use Node.js 70 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 71 | with: 72 | cache: 'npm' 73 | - run: npm install 74 | - run: node tools/validate-property-camelcase.mjs 75 | 76 | pinact: 77 | runs-on: ubuntu-latest 78 | steps: 79 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 80 | - name: Run pinact 81 | uses: suzuki-shunsuke/pinact-action@a6896d13d22e2bf108a78b0c52d3f867c1f41b34 # v0.2.1 82 | with: 83 | skip_push: "true" 84 | -------------------------------------------------------------------------------- /.github/workflows/close-issue.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues 2 | # https://github.com/marketplace/actions/close-stale-issues 3 | name: Close inactive issues 4 | on: 5 | schedule: 6 | - cron: "30 1 * * *" 7 | 8 | jobs: 9 | close-issues: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | issues: write 13 | pull-requests: write 14 | steps: 15 | - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 16 | with: 17 | days-before-issue-stale: 14 18 | days-before-issue-close: 0 19 | stale-issue-label: "no-activity" 20 | close-issue-message: "This issue was closed because it has been inactive for 14 days." 21 | exempt-issue-labels: "bug,enhancement,keep,untriaged" 22 | days-before-pr-stale: 14 23 | days-before-pr-close: 0 24 | stale-pr-label: "no-activity" 25 | close-pr-message: "This pull request was closed because it has been inactive for 14 days. Please reopen if you still intend to submit this pull request, or submit issues at first." 26 | repo-token: ${{ secrets.GITHUB_TOKEN }} 27 | -------------------------------------------------------------------------------- /.github/workflows/label-issue.yml: -------------------------------------------------------------------------------- 1 | name: Label issue 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | - reopened 8 | - closed 9 | 10 | jobs: 11 | label-issues: 12 | runs-on: ubuntu-latest 13 | permissions: 14 | issues: write 15 | steps: 16 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 17 | 18 | - name: Add label on issue open 19 | if: github.event.action == 'opened' || github.event.action == 'reopened' 20 | run: | 21 | gh issue edit ${{ github.event.issue.number }} \ 22 | --add-label "untriaged" \ 23 | env: 24 | GH_TOKEN: ${{ github.token }} 25 | 26 | - name: Remove label on issue close 27 | if: github.event.action == 'closed' 28 | run: | 29 | gh issue edit ${{ github.event.issue.number }} \ 30 | --remove-label "untriaged" 31 | env: 32 | GH_TOKEN: ${{ github.token }} 33 | -------------------------------------------------------------------------------- /.github/workflows/sdk-testing.yml: -------------------------------------------------------------------------------- 1 | name: SDK Test Automation 2 | 3 | on: 4 | push: 5 | pull_request: 6 | merge_group: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | test-java: 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: read 14 | pull-requests: write 15 | actions: read 16 | steps: 17 | - name: Checkout SDK repo 18 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 19 | with: 20 | repository: 'line/line-bot-sdk-java' 21 | submodules: recursive 22 | 23 | - name: Update line-openapi submodule 24 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 25 | with: 26 | path: './line-openapi' 27 | 28 | # https://github.com/line/line-bot-sdk-java/blob/master/.github/workflows/gradle.yml 29 | - name: Setup Java 30 | uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 31 | with: 32 | distribution: 'temurin' 33 | java-version: '17' 34 | 35 | - name: Generate code 36 | run: python3 generate-code.py 37 | 38 | - name: Show diff 39 | run: | 40 | git add . 41 | git diff --color=always --staged 42 | 43 | - name: Post PR comment 44 | if : ${{ github.event_name == 'pull_request' }} 45 | uses: ./line-openapi/.github/actions/post-comment-action 46 | with: 47 | language: java 48 | github-token: ${{ secrets.GITHUB_TOKEN }} 49 | 50 | - name: Execute Java SDK test 51 | run: ./gradlew build 52 | 53 | test-python: 54 | runs-on: ubuntu-latest 55 | permissions: 56 | contents: read 57 | pull-requests: write 58 | actions: read 59 | steps: 60 | - name: Checkout SDK repo 61 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 62 | with: 63 | repository: 'line/line-bot-sdk-python' 64 | submodules: recursive 65 | 66 | - name: Update line-openapi submodule 67 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 68 | with: 69 | path: './line-openapi' 70 | 71 | # https://github.com/line/line-bot-sdk-python/blob/master/.github/workflows/auto-testing.yml 72 | - name: Setup Python 73 | uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 74 | with: 75 | python-version: '3.11' 76 | 77 | - name: Install dependencies 78 | run: | 79 | python -m pip install --upgrade pip 80 | if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi 81 | 82 | - name: Generate code 83 | run: python3 generate-code.py 84 | 85 | - name: Show diff 86 | run: | 87 | git add . 88 | git diff --color=always --staged 89 | 90 | - name: Post PR comment 91 | if : ${{ github.event_name == 'pull_request' }} 92 | uses: ./line-openapi/.github/actions/post-comment-action 93 | with: 94 | language: python 95 | github-token: ${{ secrets.GITHUB_TOKEN }} 96 | 97 | - name: Test with pytest 98 | run: tox 99 | 100 | test-php: 101 | runs-on: ubuntu-latest 102 | permissions: 103 | contents: read 104 | pull-requests: write 105 | actions: read 106 | steps: 107 | - name: Checkout SDK repo 108 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 109 | with: 110 | repository: 'line/line-bot-sdk-php' 111 | submodules: recursive 112 | 113 | - name: Update line-openapi submodule 114 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 115 | with: 116 | path: './line-openapi' 117 | 118 | # https://github.com/line/line-bot-sdk-php/blob/master/.github/workflows/php-checks.yml 119 | - name: Setup PHP 120 | uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0 121 | with: 122 | php-version: '8.2' 123 | 124 | - name: Install openapi-generator-cli 125 | run: echo "OPENAPI_GENERATOR_VERSION=7.11.0" >> $GITHUB_ENV 126 | - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 127 | id: openapi-generator-cache 128 | env: 129 | cache-name: openapi-generator-cache 130 | with: 131 | path: ~/bin/openapitools 132 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENAPI_GENERATOR_VERSION }} 133 | - if: steps.openapi-generator-cache.outputs.cache-hit != 'true' 134 | run: | 135 | mkdir -p ~/bin/openapitools 136 | curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli 137 | chmod u+x ~/bin/openapitools/openapi-generator-cli 138 | export PATH=$PATH:~/bin/openapitools/ 139 | OPENAPI_GENERATOR_VERSION=${{ env.OPENAPI_GENERATOR_VERSION }} openapi-generator-cli version 140 | 141 | - name: Generate code 142 | run: | 143 | export PATH=$PATH:~/bin/openapitools/ 144 | bash tools/gen-oas-client.sh 145 | 146 | - name: Get Composer Cache Directory 147 | id: composer-cache 148 | run: | 149 | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT 150 | 151 | - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 152 | with: 153 | path: ${{ steps.composer-cache.outputs.dir }} 154 | key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} 155 | restore-keys: | 156 | ${{ runner.os }}-php-${{ matrix.php }}- 157 | 158 | - name: Install dependencies with Composer 159 | uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # 3.1.0 160 | 161 | - name: Show diff 162 | run: | 163 | git add . 164 | git diff --color=always --staged 165 | 166 | - name: Post PR comment 167 | if : ${{ github.event_name == 'pull_request' }} 168 | uses: ./line-openapi/.github/actions/post-comment-action 169 | with: 170 | language: php 171 | github-token: ${{ secrets.GITHUB_TOKEN }} 172 | 173 | - name: Run unit tests 174 | run: ./vendor/bin/phpunit --test-suffix=Test.php 175 | 176 | test-nodejs: 177 | runs-on: ubuntu-latest 178 | permissions: 179 | contents: read 180 | pull-requests: write 181 | actions: read 182 | steps: 183 | - name: Checkout SDK repo 184 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 185 | with: 186 | repository: 'line/line-bot-sdk-nodejs' 187 | submodules: recursive 188 | 189 | - name: Update line-openapi submodule 190 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 191 | with: 192 | path: './line-openapi' 193 | 194 | # https://github.com/line/line-bot-sdk-nodejs/blob/master/.github/workflows/test.yml 195 | - name: Setup Java 196 | uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 197 | with: 198 | distribution: 'temurin' 199 | java-version: 17 200 | architecture: x64 201 | 202 | - name: Setup Node.js 203 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 204 | with: 205 | node-version: '20' 206 | 207 | - name: Install Dependency 208 | run: npm ci 209 | 210 | - name: Generate code 211 | run: python3 generate-code.py 212 | 213 | - name: Show diff 214 | run: | 215 | git add . 216 | git diff --color=always --staged 217 | 218 | - name: Post PR comment 219 | if : ${{ github.event_name == 'pull_request' }} 220 | uses: ./line-openapi/.github/actions/post-comment-action 221 | with: 222 | language: nodejs 223 | github-token: ${{ secrets.GITHUB_TOKEN }} 224 | 225 | - name: Test Project 226 | run: export NODE_OPTIONS=--max-old-space-size=6144; npm test 227 | 228 | test-go: 229 | runs-on: ubuntu-latest 230 | permissions: 231 | contents: read 232 | pull-requests: write 233 | actions: read 234 | steps: 235 | - name: Checkout SDK repo 236 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 237 | with: 238 | repository: 'line/line-bot-sdk-go' 239 | submodules: recursive 240 | 241 | - name: Update line-openapi submodule 242 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 243 | with: 244 | path: './line-openapi' 245 | 246 | # https://github.com/line/line-bot-sdk-go/blob/master/.github/workflows/go.yml 247 | - name: Setup Java 248 | uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 249 | with: 250 | distribution: 'temurin' 251 | java-version: 17 252 | architecture: x64 253 | 254 | - name: Set up Python 255 | uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 256 | with: 257 | python-version: '3.x' 258 | 259 | - name: Set up Go 260 | uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 261 | with: 262 | go-version: stable 263 | 264 | - name: Install goimports 265 | run: go install golang.org/x/tools/cmd/goimports@latest 266 | 267 | - name: Generate code 268 | run: python generate-code.py 269 | 270 | - name: Show diff 271 | run: | 272 | git add . 273 | git diff --color=always --staged 274 | 275 | - name: Post PR comment 276 | if : ${{ github.event_name == 'pull_request' }} 277 | uses: ./line-openapi/.github/actions/post-comment-action 278 | with: 279 | language: go 280 | github-token: ${{ secrets.GITHUB_TOKEN }} 281 | 282 | - name: run tests 283 | run: go test ./... 284 | 285 | - name: go vet 286 | run: go vet $(go list ./... | grep -v /examples/) 287 | 288 | - name: Compile example scripts 289 | run: | 290 | for file in $(find ./examples/ -name '*.go'); do 291 | dir=$(dirname $file) 292 | pushd $dir 293 | go build -o /dev/null 294 | popd 295 | done 296 | 297 | test-ruby: 298 | runs-on: ubuntu-latest 299 | permissions: 300 | contents: read 301 | pull-requests: write 302 | actions: read 303 | steps: 304 | - name: Checkout SDK repo 305 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 306 | with: 307 | repository: 'line/line-bot-sdk-ruby' 308 | submodules: recursive 309 | 310 | - name: Update line-openapi submodule 311 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 312 | with: 313 | path: './line-openapi' 314 | 315 | # https://github.com/line/line-bot-sdk-ruby/blob/master/.github/workflows/pull_request.yml 316 | - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0 317 | with: 318 | ruby-version: 3.4 319 | - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 320 | with: 321 | distribution: 'temurin' 322 | java-version: 17 323 | architecture: x64 324 | - run: bundle install 325 | 326 | - name: Generate code 327 | run: python3 generate-code.py 328 | 329 | - name: Show diff 330 | run: | 331 | git add . 332 | git diff --color=always --staged 333 | 334 | - name: Post PR comment 335 | if : ${{ github.event_name == 'pull_request' }} 336 | uses: ./line-openapi/.github/actions/post-comment-action 337 | with: 338 | language: ruby 339 | github-token: ${{ secrets.GITHUB_TOKEN }} 340 | 341 | - name: Run tests 342 | run: bundle exec rake ci 343 | -------------------------------------------------------------------------------- /.github/workflows/warn-pr-from-forked-repository.yml: -------------------------------------------------------------------------------- 1 | name: Warn PR from forked repository 2 | 3 | on: 4 | # Intentional: forked repository doesn't have write permission to the base repository. 5 | pull_request_target: 6 | types: [opened] 7 | 8 | jobs: 9 | comment-on-forked-pr: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: read 13 | pull-requests: write 14 | steps: 15 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 16 | - name: Add a comment if PR is from a fork 17 | if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} 18 | run: | 19 | PR_AUTHOR=${{ github.event.pull_request.user.login }} 20 | COMMENT=":warning: Attention @$PR_AUTHOR! 21 | Thank you for your interest in contributing to this repository! 22 | 23 | This repository primarily exists to convert publicly available LINE APIs into OpenAPI YAML, making it easier for developers to access the features. 24 | Our employees mainly update the schema based on the latest features and changes in our APIs. 25 | 26 | Therefore, it is not intended for open contributions by editing files in this repository, from outside contributors. 27 | 28 | Please start by creating an issue and discussing it there. You may close this pull request and create an issue instead. 29 | 30 | == 31 | If you are an employee participating in this organization, please push branches directly to this repository to create PR, instead of using a forked repository. 32 | " 33 | 34 | gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT" 35 | env: 36 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /generated/*/target/ 2 | /tmp/ 3 | /node_modules/ 4 | .idea 5 | 6 | 7 | node_modules 8 | -------------------------------------------------------------------------------- /.spectral.yaml: -------------------------------------------------------------------------------- 1 | extends: 2 | - '@ibm-cloud/openapi-ruleset' 3 | - 'spectral:oas' 4 | rules: 5 | # `oas3-unused-component` doesn't care about discriminator. 6 | # https://github.com/stoplightio/spectral/issues/1271 7 | oas3-unused-component: off 8 | # We can't clarify the contact point at this time. 9 | info-contact: off 10 | 11 | # https://github.com/IBM/openapi-validator/blob/main/docs/ibm-cloud-rules.md 12 | 13 | # some API end points doesn't have a version number in path. 14 | major-version-in-path: off 15 | # we're using kebab case. 16 | operation-id-case-convention: off 17 | parameter-case-convention: off 18 | property-case-convention: off 19 | path-segment-case-convention: off 20 | operation-id-naming-convention: off 21 | # This rule doesn't match to our API specs. 22 | enum-case-convention: off 23 | # This rule doesn't match to our API specs. 24 | response-status-codes: off 25 | # Can't care both description and summary at this time. 26 | # TODO We may write summary field in the future. 27 | operation-summary: off 28 | # We're using `format: uri`. But it's not allowed by '@ibm-cloud/openapi-ruleset'. 29 | valid-type-format: off 30 | # I can't understand why it's needed. 31 | request-body-name: off 32 | # we don't use ibm-cloud's pagination style 33 | pagination-style: off 34 | # description-mentions-json is meaningless 35 | description-mentions-json: off 36 | schema-description: off 37 | collection-array-property: off 38 | response-error-response-schema: off 39 | array-boundary: off 40 | string-boundary: off 41 | 42 | overrides: 43 | # TODO Response detail wasn't documented yet. 44 | - files: 45 | - "module.yml#/paths/~1v2~1bot~1channel~1detach" 46 | - "module.yml#/paths/~1v2~1bot~1chat~1{chatId}~1control~1acquire" 47 | - "module.yml#/paths/~1v2~1bot~1chat~1{chatId}~1control~1release" 48 | - "shop.yml#/paths/~1shop~1v3~1mission" 49 | rules: 50 | content-entry-provided: off 51 | 52 | # blob response 53 | - files: 54 | - "messaging-api-blob.yml#/paths/~1v2~1bot~1message~1{messageId}~1content/get" 55 | - "messaging-api-blob.yml#/paths/~1v2~1bot~1message~1{messageId}~1content~1preview/get" 56 | - "messaging-api-blob.yml#/paths/~1v2~1bot~1richmenu~1{richMenuId}~1content/get" 57 | - "messaging-api-blob.yml#/paths/~1v2~1bot~1richmenu~1{richMenuId}~1content/post" 58 | - "messaging-api-blob.yml#/paths/~1v2~1bot~1message~1{messageId}~1content~1transcoding/get" 59 | rules: 60 | string-boundary: off 61 | ibm-content-type-is-specific: off 62 | 63 | # empty response 64 | - files: 65 | - "messaging-api.yml#/paths" 66 | - "manage-audience.yml#/paths/~1v2~1bot~1audienceGroup~1upload" 67 | - "manage-audience.yml#/paths/~1v2~1bot~1audienceGroup~1{audienceGroupId}" 68 | - "manage-audience.yml#/paths/~1v2~1bot~1audienceGroup~1authorityLevel/put" 69 | - "manage-audience-blob.yml#/paths" 70 | - "channel-access-token.yml#/paths/~1oauth2~1v2.1~1revoke" 71 | - "channel-access-token.yml#/paths/~1v2~1oauth~1revoke" 72 | - "messaging-api-blob.yml#/paths/~1v2~1bot~1richmenu~1{richMenuId}~1content" 73 | rules: 74 | content-entry-provided: off 75 | 76 | # enum with null issue. 77 | - files: 78 | - "manage-audience.yml#/paths/~1v2~1bot~1audienceGroup~1{audienceGroupId}" 79 | rules: 80 | oas3-valid-media-example: off 81 | 82 | # e.g. spectral lint messaging-api.yml --ruleset=.spectral.yaml 83 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | [dl_oss_dev@linecorp.com](mailto:dl_oss_dev@linecorp.com). 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. 120 | 121 | Community Impact Guidelines were inspired by 122 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 123 | 124 | For answers to common questions about this code of conduct, see the FAQ at 125 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available 126 | at [https://www.contributor-covenant.org/translations][translations]. 127 | 128 | [homepage]: https://www.contributor-covenant.org 129 | [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html 130 | [Mozilla CoC]: https://github.com/mozilla/diversity 131 | [FAQ]: https://www.contributor-covenant.org/faq 132 | [translations]: https://www.contributor-covenant.org/translations 133 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright (C) 2016 LINE Corp. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LINE OpenAPI 2 | 3 | ## What's this? 4 | 5 | This is the OpenAPI spec of the LINE's Public APIs. 6 | 7 | If you have an interesting use case for these files or have a request, please create an issue. 8 | 9 | ### Which APIs are supported in this repository? 10 | 11 | 1. This repository provides OpenAPI spec of the APIs, that listed on https://developers.line.biz/en/docs/. 12 | 2. This repository covers APIs on `api.line.me`, `api-data.line.me` and `manager.line.biz`. 13 | 14 | ## Project Files 15 | 16 | | File | OpenAPI Version | API EndPoint | Description | 17 | |--------------------------|-----------------|-------------------------------------------------------------------------------------------|--------------------------| 18 | | channel-access-token.yml | 3.0.0 | https://api.line.me/ | Channel Access Token API | 19 | | insight.yml | 3.0.0 | https://api.line.me/v2/bot/insight/ | Insight API | 20 | | liff.yml | 3.0.2 | https://api.line.me/liff/ | LIFF API | 21 | | manage-audience.yml | 3.0.0 | https://api.line.me/v2/bot/audienceGroup/, https://api-data.line.me/v2/bot/audienceGroup/ | Audience Group API | 22 | | messaging-api.yml | 3.0.0 | https://api.line.me/v2/bot/, https://api-data.line.me/v2/bot/ | Messaging API | 23 | | module.yml | 3.0.0 | https://api.line.me/v2/bot/ | Messaging API | 24 | | module-attach.yml | 3.0.0 | https://manager.line.biz/module/auth/v1/token | Messaging API | 25 | | shop.yml | 3.0.0 | https://api.line.me/shop/ | Mission Stickers API | 26 | | | | | | 27 | | webhook.yml | 3.0.3 | | Webhook Event Objects | 28 | 29 | ## How to Contribute 30 | 31 | Thank you for your interest in contributing to the **line/line-openapi** repository! 32 | This project just publishes our public features as an OpenAPI schema to help developers easily access and integrate with them. 33 | Our employees mainly update the schema based on the latest features and changes in our APIs. 34 | 35 | Please note the following guidelines: 36 | 37 | 1. **Pull Requests** 38 | We currently only accept Pull Requests from our employees. 39 | 40 | 2. **Issues First** 41 | If you would like to propose a change, or discuss a problem, please open an issue first. 42 | 43 | ## Known issues 44 | 45 | - OpenAPI Generator can't generate Python client with Java 17+ 46 | - https://github.com/OpenAPITools/openapi-generator/issues/13684 47 | -------------------------------------------------------------------------------- /channel-access-token.yml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.0 3 | info: 4 | title: Channel Access Token API 5 | version: "0.0.1" 6 | description: 7 | This document describes Channel Access Token API. 8 | 9 | servers: 10 | - url: "https://api.line.me" 11 | 12 | tags: 13 | - name: channel-access-token 14 | 15 | paths: 16 | "/oauth2/v3/token": 17 | post: 18 | externalDocs: 19 | url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token 20 | tags: 21 | - channel-access-token 22 | operationId: issueStatelessChannelToken 23 | description: | 24 | Issues a new stateless channel access token, which doesn't have max active token limit 25 | unlike the other token types. 26 | The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. 27 | requestBody: 28 | required: true 29 | content: 30 | application/x-www-form-urlencoded: 31 | schema: 32 | oneOf: 33 | - $ref: "#/components/schemas/IssueStatelessChannelTokenByJWTAssertionRequest" 34 | - $ref: "#/components/schemas/IssueStatelessChannelTokenByClientSecretRequest" 35 | responses: 36 | "200": 37 | description: "OK" 38 | content: 39 | application/json: 40 | schema: 41 | "$ref": "#/components/schemas/IssueStatelessChannelAccessTokenResponse" 42 | example: 43 | token_type: Bearer 44 | access_token: eyJhbGciOiJIUz..... 45 | expires_in: 899 46 | 47 | "/oauth2/v2.1/tokens/kid": 48 | get: 49 | externalDocs: 50 | url: https://developers.line.biz/en/reference/messaging-api/#get-all-valid-channel-access-token-key-ids-v2-1 51 | tags: 52 | - channel-access-token 53 | operationId: getsAllValidChannelAccessTokenKeyIds 54 | description: "Gets all valid channel access token key IDs." 55 | parameters: 56 | - name: client_assertion_type 57 | in: query 58 | required: true 59 | description: "`urn:ietf:params:oauth:client-assertion-type:jwt-bearer`" 60 | schema: 61 | type: string 62 | - name: client_assertion 63 | in: query 64 | required: true 65 | description: "A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key." 66 | schema: 67 | type: string 68 | responses: 69 | "200": 70 | description: "OK" 71 | content: 72 | application/json: 73 | schema: 74 | "$ref": "#/components/schemas/ChannelAccessTokenKeyIdsResponse" 75 | example: 76 | kids: 77 | - U_gdnFYKTWRxxxxDVZexGg 78 | - sDTOzw5wIfWxxxxzcmeQA 79 | - 73hDyp3PxGfxxxxD6U5qYA 80 | - FHGanaP79smDxxxxyPrVw 81 | - CguB-0kxxxxdSM3A5Q_UtQ 82 | - G82YP96jhHwyKSxxxx7IFA 83 | 84 | "/oauth2/v2.1/token": 85 | post: 86 | externalDocs: 87 | url: https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1 88 | tags: 89 | - channel-access-token 90 | operationId: issueChannelTokenByJWT 91 | description: "Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication." 92 | requestBody: 93 | required: true 94 | content: 95 | application/x-www-form-urlencoded: 96 | schema: 97 | description: "request of the issueChannelTokenByJWT" 98 | type: object 99 | properties: 100 | grant_type: 101 | type: string 102 | description: "client_credentials" 103 | client_assertion_type: 104 | type: string 105 | description: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" 106 | client_assertion: 107 | type: string 108 | description: "A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key." 109 | required: 110 | - grant_type 111 | - client_assertion_type 112 | - client_assertion 113 | responses: 114 | "200": 115 | description: "OK" 116 | content: 117 | application/json: 118 | schema: 119 | "$ref": "#/components/schemas/IssueChannelAccessTokenResponse" 120 | example: 121 | access_token: eyJhbGciOiJIUz..... 122 | token_type: Bearer 123 | expires_in: 2592000 124 | key_id: sDTOzw5wIfxxxxPEzcmeQA 125 | 126 | "/oauth2/v2.1/verify": 127 | get: 128 | externalDocs: 129 | url: https://developers.line.biz/en/reference/messaging-api/#verify-channel-access-token-v2-1 130 | tags: 131 | - channel-access-token 132 | operationId: verifyChannelTokenByJWT 133 | description: "You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid." 134 | parameters: 135 | - name: access_token 136 | in: query 137 | required: true 138 | description: "Channel access token with a user-specified expiration (Channel Access Token v2.1)." 139 | schema: 140 | type: string 141 | responses: 142 | "200": 143 | description: "OK" 144 | content: 145 | application/json: 146 | schema: 147 | "$ref": "#/components/schemas/VerifyChannelAccessTokenResponse" 148 | example: 149 | client_id: "1573163733" 150 | expires_in: 2591659 151 | scope: profile chat_message.write 152 | 153 | "/oauth2/v2.1/revoke": 154 | post: 155 | externalDocs: 156 | url: https://developers.line.biz/en/reference/messaging-api/#revoke-channel-access-token-v2-1 157 | tags: 158 | - channel-access-token 159 | operationId: revokeChannelTokenByJWT 160 | description: "Revoke channel access token v2.1" 161 | requestBody: 162 | required: true 163 | content: 164 | application/x-www-form-urlencoded: 165 | schema: 166 | description: "Request of the revokeChannelTokenByJWT" 167 | type: object 168 | properties: 169 | client_id: 170 | type: string 171 | description: "Channel ID" 172 | client_secret: 173 | type: string 174 | description: "Channel Secret" 175 | access_token: 176 | type: string 177 | description: "Channel access token" 178 | required: 179 | - client_id 180 | - client_secret 181 | - access_token 182 | responses: 183 | "200": 184 | description: "OK" 185 | 186 | "/v2/oauth/accessToken": 187 | post: 188 | externalDocs: 189 | url: https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token 190 | tags: 191 | - channel-access-token 192 | operationId: issueChannelToken 193 | description: "Issue short-lived channel access token" 194 | requestBody: 195 | required: true 196 | content: 197 | application/x-www-form-urlencoded: 198 | schema: 199 | description: "Request of the issueChannelToken" 200 | type: object 201 | properties: 202 | grant_type: 203 | type: string 204 | description: "`client_credentials`" 205 | example: client_credentials 206 | client_id: 207 | type: string 208 | description: "Channel ID." 209 | client_secret: 210 | type: string 211 | description: "Channel secret." 212 | required: 213 | - grant_type 214 | - client_id 215 | - client_secret 216 | responses: 217 | "200": 218 | description: "OK" 219 | content: 220 | application/json: 221 | schema: 222 | "$ref": "#/components/schemas/IssueShortLivedChannelAccessTokenResponse" 223 | example: 224 | access_token: W1TeHCgfH2Liwa..... 225 | expires_in: 2592000 226 | token_type: Bearer 227 | "400": 228 | description: "Bad Request" 229 | content: 230 | application/json: 231 | schema: 232 | "$ref": "#/components/schemas/ErrorResponse" 233 | example: 234 | error: invalid_request 235 | error_description: "some parameters missed or invalid" 236 | 237 | "/v2/oauth/verify": 238 | post: 239 | externalDocs: 240 | url: https://developers.line.biz/en/reference/messaging-api/#verify-channel-access-token 241 | tags: 242 | - channel-access-token 243 | operationId: verifyChannelToken 244 | description: "Verify the validity of short-lived and long-lived channel access tokens" 245 | requestBody: 246 | required: true 247 | content: 248 | application/x-www-form-urlencoded: 249 | schema: 250 | description: "request of the verifyChannelToken" 251 | type: object 252 | properties: 253 | access_token: 254 | description: "A short-lived or long-lived channel access token." 255 | type: string 256 | required: 257 | - access_token 258 | responses: 259 | "200": 260 | description: "OK" 261 | content: 262 | application/json: 263 | schema: 264 | "$ref": "#/components/schemas/VerifyChannelAccessTokenResponse" 265 | example: 266 | client_id: "1350031035" 267 | expires_in: 3138007490 268 | scope: P CM 269 | 270 | "/v2/oauth/revoke": 271 | post: 272 | externalDocs: 273 | url: https://developers.line.biz/en/reference/messaging-api/#revoke-longlived-or-shortlived-channel-access-token 274 | tags: 275 | - channel-access-token 276 | operationId: revokeChannelToken 277 | description: "Revoke short-lived or long-lived channel access token" 278 | requestBody: 279 | required: true 280 | content: 281 | application/x-www-form-urlencoded: 282 | schema: 283 | description: "Request of the revokeChannelToken." 284 | type: object 285 | properties: 286 | access_token: 287 | description: "Channel access token" 288 | type: string 289 | required: 290 | - access_token 291 | responses: 292 | "200": 293 | description: "OK" 294 | 295 | components: 296 | schemas: 297 | IssueStatelessChannelTokenByJWTAssertionRequest: 298 | externalDocs: 299 | url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token 300 | description: "Request body to issue a new token with JWT assertion" 301 | type: object 302 | required: 303 | - grant_type 304 | - client_assertion 305 | - client_assertion_type 306 | properties: 307 | grant_type: 308 | type: string 309 | enum: [ client_credentials ] 310 | description: "client_credentials" 311 | client_assertion_type: 312 | type: string 313 | enum: [ urn:ietf:params:oauth:client-assertion-type:jwt-bearer ] 314 | description: "URL-encoded value of `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`" 315 | client_assertion: 316 | type: string 317 | description: "A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key." 318 | IssueStatelessChannelTokenByClientSecretRequest: 319 | externalDocs: 320 | url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token 321 | description: "Request body to issue a new token with `client_id` and `client_secret`" 322 | type: object 323 | required: 324 | - grant_type 325 | - client_id 326 | - client_secret 327 | properties: 328 | grant_type: 329 | type: string 330 | enum: [ client_credentials ] 331 | description: "`client_credentials`" 332 | client_id: 333 | type: string 334 | description: "Channel ID." 335 | client_secret: 336 | type: string 337 | description: "Channel secret." 338 | IssueStatelessChannelAccessTokenResponse: 339 | externalDocs: 340 | url: https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token 341 | description: "Issued stateless channel access token" 342 | required: 343 | - access_token 344 | - expires_in 345 | - token_type 346 | type: object 347 | properties: 348 | access_token: 349 | type: string 350 | description: |+ 351 | A stateless channel access token. 352 | The token is an opaque string which means its format is an implementation detail 353 | and the consumer of this token should never try to use the data parsed from the token. 354 | expires_in: 355 | type: integer 356 | format: int32 357 | description: "Duration in seconds after which the issued access token expires" 358 | token_type: 359 | type: string 360 | default: Bearer 361 | description: "Token type. The value is always `Bearer`." 362 | ChannelAccessTokenKeyIdsResponse: 363 | externalDocs: 364 | url: https://developers.line.biz/en/reference/messaging-api/#get-all-valid-channel-access-token-key-ids-v2-1 365 | description: "Channel access token key IDs" 366 | required: 367 | - kids 368 | type: object 369 | properties: 370 | kids: 371 | description: "Array of channel access token key IDs." 372 | type: array 373 | items: 374 | type: string 375 | IssueShortLivedChannelAccessTokenResponse: 376 | externalDocs: 377 | url: https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token 378 | description: "Issued short-lived channel access token" 379 | required: 380 | - access_token 381 | - expires_in 382 | - token_type 383 | type: object 384 | properties: 385 | access_token: 386 | type: string 387 | description: |+ 388 | A short-lived channel access token. Valid for 30 days. 389 | Note: Channel access tokens cannot be refreshed. 390 | expires_in: 391 | type: integer 392 | format: int32 393 | description: "Time until channel access token expires in seconds from time the token is issued." 394 | token_type: 395 | type: string 396 | default: Bearer 397 | description: "Token type. The value is always `Bearer`." 398 | IssueChannelAccessTokenResponse: 399 | externalDocs: 400 | url: https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1 401 | description: "Issued channel access token" 402 | required: 403 | - access_token 404 | - expires_in 405 | - token_type 406 | - key_id 407 | type: object 408 | properties: 409 | access_token: 410 | type: string 411 | description: |+ 412 | Channel access token. 413 | expires_in: 414 | type: integer 415 | format: int32 416 | description: "Amount of time in seconds from issue to expiration of the channel access token" 417 | token_type: 418 | type: string 419 | default: Bearer 420 | description: "A token type." 421 | key_id: 422 | type: string 423 | description: "Unique key ID for identifying the channel access token." 424 | VerifyChannelAccessTokenResponse: 425 | description: "Verification result" 426 | required: 427 | - client_id 428 | - expires_in 429 | type: object 430 | properties: 431 | client_id: 432 | type: string 433 | description: "The channel ID for which the channel access token was issued." 434 | expires_in: 435 | type: integer 436 | format: int64 437 | description: "Number of seconds before the channel access token expires." 438 | scope: 439 | type: string 440 | description: "Permissions granted to the channel access token." 441 | 442 | ErrorResponse: 443 | description: "Error response of the Channel access token" 444 | type: object 445 | properties: 446 | error: 447 | description: "Error summary" 448 | type: string 449 | error_description: 450 | description: "Details of the error. Not returned in certain situations." 451 | type: string 452 | -------------------------------------------------------------------------------- /insight.yml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.0 3 | info: 4 | title: LINE Messaging API(Insight) 5 | version: "0.0.1" 6 | description: 7 | This document describes LINE Messaging API(Insight). 8 | 9 | servers: 10 | - url: "https://api.line.me" 11 | 12 | security: 13 | - Bearer: [] 14 | 15 | tags: 16 | - name: insight 17 | 18 | paths: 19 | "/v2/bot/insight/demographic": 20 | get: 21 | externalDocs: 22 | url: https://developers.line.biz/en/reference/messaging-api/#get-demographic 23 | tags: 24 | - insight 25 | operationId: getFriendsDemographics 26 | description: |+ 27 | Retrieves the demographic attributes for a LINE Official Account's 28 | friends.You can only retrieve information about friends for LINE Official 29 | Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia 30 | (ID). 31 | responses: 32 | "200": 33 | content: 34 | "application/json": 35 | schema: 36 | $ref: "#/components/schemas/GetFriendsDemographicsResponse" 37 | example: 38 | available: true 39 | genders: 40 | - gender: unknown 41 | percentage: 37.6 42 | - gender: male 43 | percentage: 31.8 44 | - gender: female 45 | percentage: 30.6 46 | ages: 47 | - age: unknown 48 | percentage: 37.6 49 | - age: from50 50 | percentage: 17.3 51 | areas: 52 | - area: unknown 53 | percentage: 42.9 54 | - area: 徳島 55 | percentage: 2.9 56 | appTypes: 57 | - appType: ios 58 | percentage: 62.4 59 | - appType: android 60 | percentage: 27.7 61 | - appType: others 62 | percentage: 9.9 63 | subscriptionPeriods: 64 | - subscriptionPeriod: over365days 65 | percentage: 96.4 66 | - subscriptionPeriod: within365days 67 | percentage: 1.9 68 | - subscriptionPeriod: within180days 69 | percentage: 1.2 70 | - subscriptionPeriod: within90days 71 | percentage: 0.5 72 | - subscriptionPeriod: within30days 73 | percentage: 0.1 74 | - subscriptionPeriod: within7days 75 | percentage: 0 76 | description: "OK" 77 | 78 | "/v2/bot/insight/message/delivery": 79 | get: 80 | externalDocs: 81 | url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages 82 | tags: 83 | - insight 84 | operationId: getNumberOfMessageDeliveries 85 | description: |+ 86 | Returns the number of messages sent from LINE Official Account 87 | on a specified day. 88 | parameters: 89 | - in: query 90 | name: date 91 | description: |+ 92 | Date for which to retrieve number of sent messages. 93 | - Format: yyyyMMdd (e.g. 20191231) 94 | - Timezone: UTC+9 95 | required: true 96 | schema: 97 | type: string 98 | pattern: "^[0-9]{8}$" 99 | minLength: 8 100 | maxLength: 8 101 | responses: 102 | "200": 103 | content: 104 | "application/json": 105 | schema: 106 | $ref: "#/components/schemas/GetNumberOfMessageDeliveriesResponse" 107 | example: 108 | status: ready 109 | broadcast: 5385 110 | targeting: 522 111 | description: "OK" 112 | summary: "Get number of message deliveries" 113 | 114 | "/v2/bot/insight/followers": 115 | get: 116 | externalDocs: 117 | url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers 118 | tags: 119 | - insight 120 | summary: "Get number of followers" 121 | description: |+ 122 | Returns the number of users who have added the LINE Official Account 123 | on or before a specified date. 124 | operationId: getNumberOfFollowers 125 | parameters: 126 | - in: query 127 | name: date 128 | required: false 129 | description: |+ 130 | Date for which to retrieve the number of followers. 131 | 132 | Format: yyyyMMdd (e.g. 20191231) 133 | Timezone: UTC+9 134 | schema: 135 | type: string 136 | pattern: "^[0-9]{8}$" 137 | maxLength: 8 138 | minLength: 8 139 | responses: 140 | "200": 141 | description: "OK" 142 | content: 143 | "application/json": 144 | schema: 145 | $ref: "#/components/schemas/GetNumberOfFollowersResponse" 146 | example: 147 | status: ready 148 | followers: 7620 149 | targetedReaches: 5848 150 | blocks: 237 151 | 152 | "/v2/bot/insight/message/event": 153 | get: 154 | externalDocs: 155 | url: https://developers.line.biz/en/reference/messaging-api/#get-message-event 156 | tags: 157 | - insight 158 | description: |+ 159 | Returns statistics about how users interact with narrowcast messages 160 | or broadcast messages sent from your LINE Official Account. 161 | summary: "Get user interaction statistics" 162 | operationId: getMessageEvent 163 | parameters: 164 | - in: query 165 | name: requestId 166 | required: true 167 | description: |+ 168 | Request ID of a narrowcast message or broadcast message. 169 | Each Messaging API request has a request ID. 170 | schema: 171 | # TODO maxLength and/or pattern is required for x-line-request-id 172 | type: string 173 | minLength: 1 174 | responses: 175 | "200": 176 | description: "OK" 177 | content: 178 | "application/json": 179 | schema: 180 | $ref: "#/components/schemas/GetMessageEventResponse" 181 | example: 182 | overview: 183 | requestId: f70dd685-499a-4231-a441-f24b8d4fba21 184 | timestamp: 1568214000 185 | delivered: 320 186 | uniqueImpression: 82 187 | uniqueClick: 51 188 | uniqueMediaPlayed: 189 | uniqueMediaPlayed100Percent: 190 | messages: 191 | - seq: 1 192 | impression: 136 193 | mediaPlayed: 194 | mediaPlayed25Percent: 195 | mediaPlayed50Percent: 196 | mediaPlayed75Percent: 197 | mediaPlayed100Percent: 198 | uniqueMediaPlayed: 199 | uniqueMediaPlayed25Percent: 200 | uniqueMediaPlayed50Percent: 201 | uniqueMediaPlayed75Percent: 202 | uniqueMediaPlayed100Percent: 203 | clicks: 204 | - seq: 1 205 | url: https://line.me/ 206 | click: 41 207 | uniqueClick: 30 208 | uniqueClickOfRequest: 30 209 | - seq: 1 210 | url: https://www.linebiz.com/ 211 | click: 59 212 | uniqueClick: 38 213 | uniqueClickOfRequest: 38 214 | 215 | "/v2/bot/insight/message/event/aggregation": 216 | get: 217 | externalDocs: 218 | url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit 219 | tags: 220 | - insight 221 | description: |+ 222 | You can check the per-unit statistics of how users interact with 223 | push messages and multicast messages sent from your LINE Official Account. 224 | operationId: getStatisticsPerUnit 225 | parameters: 226 | - in: query 227 | name: customAggregationUnit 228 | required: true 229 | description: |+ 230 | Name of aggregation unit specified when sending the message. Case-sensitive. 231 | For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. 232 | schema: 233 | # https://developers.line.biz/en/reference/messaging-api/#send-push-message-request-body 234 | type: string 235 | pattern: "^[a-zA-Z0-9_]{1,30}$" 236 | minLength: 1 237 | maxLength: 30 238 | - in: query 239 | name: from 240 | required: true 241 | description: |+ 242 | Start date of aggregation period. 243 | 244 | Format: yyyyMMdd (e.g. 20210301) 245 | Time zone: UTC+9 246 | schema: 247 | type: string 248 | pattern: "^[0-9]{8}$" 249 | example: "20210301" 250 | minLength: 8 251 | maxLength: 8 252 | - in: query 253 | name: to 254 | required: true 255 | description: |+ 256 | End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. 257 | 258 | Format: yyyyMMdd (e.g. 20210301) 259 | Time zone: UTC+9 260 | schema: 261 | type: string 262 | pattern: "^[0-9]{8}$" 263 | example: "20210301" 264 | minLength: 8 265 | maxLength: 8 266 | responses: 267 | "200": 268 | description: "OK" 269 | content: 270 | "application/json": 271 | schema: 272 | $ref: "#/components/schemas/GetStatisticsPerUnitResponse" 273 | example: 274 | overview: 275 | uniqueImpression: 40 276 | uniqueClick: 30 277 | uniqueMediaPlayed: 25 278 | uniqueMediaPlayed100Percent: ~ 279 | messages: 280 | - seq: 1 281 | impression: 42 282 | mediaPlayed: 30 283 | mediaPlayed25Percent: ~ 284 | mediaPlayed50Percent: ~ 285 | mediaPlayed75Percent: ~ 286 | mediaPlayed100Percent: ~ 287 | uniqueMediaPlayed: 25 288 | uniqueMediaPlayed25Percent: ~ 289 | uniqueMediaPlayed50Percent: ~ 290 | uniqueMediaPlayed75Percent: ~ 291 | uniqueMediaPlayed100Percent: ~ 292 | clicks: 293 | - seq: 1 294 | url: https://developers.line.biz/ 295 | click: 35 296 | uniqueClick: 25 297 | uniqueClickOfRequest: ~ 298 | - seq: 1 299 | url: https://developers.line.biz/ 300 | click: 29 301 | uniqueClick: ~ 302 | uniqueClickOfRequest: ~ 303 | 304 | components: 305 | securitySchemes: 306 | Bearer: 307 | type: http 308 | scheme: bearer 309 | description: "Channel access token" 310 | 311 | schemas: 312 | GetFriendsDemographicsResponse: 313 | externalDocs: 314 | url: https://developers.line.biz/en/reference/messaging-api/#get-demographic 315 | description: "Get friend demographics" 316 | type: object 317 | properties: 318 | available: 319 | type: boolean 320 | description: "true if friend demographic information is available." 321 | genders: 322 | type: array 323 | items: 324 | $ref: "#/components/schemas/GenderTile" 325 | description: "Percentage per gender." 326 | ages: 327 | type: array 328 | items: 329 | $ref: "#/components/schemas/AgeTile" 330 | description: "Percentage per age group." 331 | areas: 332 | type: array 333 | items: 334 | $ref: "#/components/schemas/AreaTile" 335 | description: "Percentage per area." 336 | appTypes: 337 | type: array 338 | items: 339 | $ref: "#/components/schemas/AppTypeTile" 340 | description: "Percentage by OS." 341 | subscriptionPeriods: 342 | items: 343 | $ref: "#/components/schemas/SubscriptionPeriodTile" 344 | type: array 345 | description: "Percentage per friendship duration." 346 | GenderTile: 347 | type: object 348 | properties: 349 | gender: 350 | type: string 351 | enum: 352 | - male 353 | - female 354 | - unknown 355 | description: "users' gender" 356 | percentage: 357 | type: number 358 | format: double 359 | description: "Percentage" 360 | AgeTile: 361 | type: object 362 | properties: 363 | age: 364 | type: string 365 | enum: 366 | - from0to14 367 | - from15to19 368 | - from20to24 369 | - from25to29 370 | - from30to34 371 | - from35to39 372 | - from40to44 373 | - from45to49 374 | - from50 375 | - from50to54 376 | - from55to59 377 | - from60to64 378 | - from65to69 379 | - from70 380 | - unknown 381 | description: "users' age" 382 | percentage: 383 | type: number 384 | format: double 385 | description: "Percentage" 386 | AreaTile: 387 | type: object 388 | properties: 389 | area: 390 | type: string 391 | description: "users' country and region" 392 | percentage: 393 | type: number 394 | format: double 395 | description: "Percentage" 396 | AppTypeTile: 397 | properties: 398 | appType: 399 | type: string 400 | enum: 401 | - ios 402 | - android 403 | - others 404 | description: "users' OS" 405 | percentage: 406 | format: double 407 | type: number 408 | description: "Percentage" 409 | type: object 410 | SubscriptionPeriodTile: 411 | properties: 412 | subscriptionPeriod: 413 | type: string 414 | description: "Subscription period. Possible values: `within7days`, `within90days`, `unknown` etc." 415 | enum: 416 | # Less than 7 days 417 | - within7days 418 | # Equal to or greater than 7 days but less than 30 days 419 | - within30days 420 | # Equal to or greater than 30 days but less than 90 days 421 | - within90days 422 | # Equal to or greater than 90 days but less than 180 days 423 | - within180days 424 | # Equal to or greater than 180 days but less than 365 days 425 | - within365days 426 | # Equal to or greater than 365 days 427 | - over365days 428 | # Unknown 429 | - unknown 430 | percentage: 431 | format: double 432 | type: number 433 | description: "Percentage. Possible values: [0.0,100.0] e.g. 0, 2.9, 37.6." 434 | type: object 435 | 436 | GetNumberOfMessageDeliveriesResponse: 437 | externalDocs: 438 | url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages 439 | description: "Get number of message deliveries" 440 | type: object 441 | properties: 442 | status: 443 | type: string 444 | enum: 445 | - ready 446 | - unready 447 | - out_of_service 448 | description: "Status of the counting process." 449 | broadcast: 450 | format: int64 451 | type: integer 452 | description: "Number of messages sent to all of this LINE Official Account's friends (broadcast messages)." 453 | targeting: 454 | format: int64 455 | type: integer 456 | description: "Number of messages sent to some of this LINE Official Account's friends, based on specific attributes (targeted messages)." 457 | autoResponse: 458 | format: int64 459 | type: integer 460 | description: "Number of auto-response messages sent." 461 | welcomeResponse: 462 | format: int64 463 | type: integer 464 | description: "Number of greeting messages sent." 465 | chat: 466 | format: int64 467 | type: integer 468 | description: "Number of messages sent from LINE Official Account Manager [Chat screen](https://www.linebiz.com/jp/manual/OfficialAccountManager/chats/) (only available in Japanese)." 469 | apiBroadcast: 470 | format: int64 471 | type: integer 472 | description: "Number of broadcast messages sent with the `Send broadcast message` Messaging API operation." 473 | apiPush: 474 | format: int64 475 | type: integer 476 | description: "Number of push messages sent with the `Send push message` Messaging API operation." 477 | apiMulticast: 478 | format: int64 479 | type: integer 480 | description: "Number of multicast messages sent with the `Send multicast message` Messaging API operation." 481 | apiNarrowcast: 482 | format: int64 483 | type: integer 484 | description: "Number of narrowcast messages sent with the `Send narrowcast message` Messaging API operation." 485 | apiReply: 486 | format: int64 487 | type: integer 488 | description: "Number of replies sent with the `Send reply message` Messaging API operation." 489 | 490 | 491 | GetNumberOfFollowersResponse: 492 | externalDocs: 493 | url: https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers 494 | description: "Get number of followers" 495 | type: object 496 | properties: 497 | status: 498 | description: "Calculation status." 499 | type: string 500 | enum: 501 | - ready 502 | - unready 503 | - out_of_service 504 | followers: 505 | type: integer 506 | format: int64 507 | description: |+ 508 | The number of times, as of the specified date, that a user added this LINE Official Account as a friend for the first time. 509 | The number doesn't decrease even if a user later blocks the account or when they delete their LINE account. 510 | targetedReaches: 511 | format: int64 512 | type: integer 513 | description: |+ 514 | The number of users, as of the specified date, that the LINE Official Account can reach through targeted messages based on gender, age, and/or region. 515 | This number only includes users who are active on LINE or LINE services and whose demographics have a high level of certainty. 516 | blocks: 517 | type: integer 518 | format: int64 519 | description: |+ 520 | The number of users blocking the account as of the specified date. 521 | The number decreases when a user unblocks the account. 522 | 523 | 524 | GetMessageEventResponse: 525 | externalDocs: 526 | url: https://developers.line.biz/en/reference/messaging-api/#get-insight-message-event-response 527 | description: "Statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account." 528 | properties: 529 | overview: 530 | $ref: "#/components/schemas/GetMessageEventResponseOverview" 531 | messages: 532 | description: "Array of information about individual message bubbles." 533 | type: array 534 | items: 535 | $ref: "#/components/schemas/GetMessageEventResponseMessage" 536 | clicks: 537 | description: "Array of information about opened URLs in the message." 538 | type: array 539 | items: 540 | $ref: "#/components/schemas/GetMessageEventResponseClick" 541 | type: object 542 | GetMessageEventResponseOverview: 543 | description: "Summary of message statistics." 544 | type: object 545 | properties: 546 | requestId: 547 | type: string 548 | description: "Request ID." 549 | timestamp: 550 | format: int64 551 | type: integer 552 | description: "UNIX timestamp for message delivery time in seconds." 553 | delivered: 554 | format: int64 555 | type: integer 556 | description: |+ 557 | Number of messages delivered. 558 | This property shows values of less than 20. 559 | However, if all messages have not been sent, it will be null. 560 | uniqueImpression: 561 | format: int64 562 | type: integer 563 | description: "Number of users who opened the message, meaning they displayed at least 1 bubble." 564 | nullable: true 565 | uniqueClick: 566 | format: int64 567 | type: integer 568 | description: "Number of users who opened any URL in the message." 569 | nullable: true 570 | uniqueMediaPlayed: 571 | format: int64 572 | type: integer 573 | description: "Number of users who started playing any video or audio in the message." 574 | nullable: true 575 | uniqueMediaPlayed100Percent: 576 | format: int64 577 | type: integer 578 | description: "Number of users who played the entirety of any video or audio in the message." 579 | nullable: true 580 | GetMessageEventResponseMessage: 581 | type: object 582 | properties: 583 | seq: 584 | format: int32 585 | type: integer 586 | description: "Bubble's serial number." 587 | impression: 588 | format: int64 589 | type: integer 590 | description: "Number of times the bubble was displayed." 591 | nullable: true 592 | mediaPlayed: 593 | format: int64 594 | type: integer 595 | description: "Number of times audio or video in the bubble started playing." 596 | nullable: true 597 | mediaPlayed25Percent: 598 | format: int64 599 | type: integer 600 | description: "Number of times audio or video in the bubble started playing and was played 25% of the total time." 601 | nullable: true 602 | mediaPlayed50Percent: 603 | format: int64 604 | type: integer 605 | description: "Number of times audio or video in the bubble started playing and was played 50% of the total time." 606 | nullable: true 607 | mediaPlayed75Percent: 608 | format: int64 609 | type: integer 610 | description: "Number of times audio or video in the bubble started playing and was played 75% of the total time." 611 | nullable: true 612 | mediaPlayed100Percent: 613 | format: int64 614 | type: integer 615 | description: "Number of times audio or video in the bubble started playing and was played 100% of the total time." 616 | nullable: true 617 | uniqueMediaPlayed: 618 | format: int64 619 | type: integer 620 | description: "Number of users that started playing audio or video in the bubble." 621 | nullable: true 622 | uniqueMediaPlayed25Percent: 623 | format: int64 624 | type: integer 625 | description: "Number of users that started playing audio or video in the bubble and played 25% of the total time." 626 | nullable: true 627 | uniqueMediaPlayed50Percent: 628 | format: int64 629 | type: integer 630 | description: "Number of users that started playing audio or video in the bubble and played 50% of the total time." 631 | nullable: true 632 | uniqueMediaPlayed75Percent: 633 | format: int64 634 | type: integer 635 | description: "Number of users that started playing audio or video in the bubble and played 75% of the total time." 636 | nullable: true 637 | uniqueMediaPlayed100Percent: 638 | format: int64 639 | type: integer 640 | description: "Number of users that started playing audio or video in the bubble and played 100% of the total time." 641 | nullable: true 642 | GetMessageEventResponseClick: 643 | type: object 644 | properties: 645 | seq: 646 | type: integer 647 | format: int32 648 | description: "The URL's serial number." 649 | url: 650 | type: string 651 | description: "URL." 652 | click: 653 | type: integer 654 | format: int64 655 | description: "Number of times the URL was opened." 656 | nullable: true 657 | uniqueClick: 658 | type: integer 659 | format: int64 660 | description: "Number of users that opened the URL." 661 | nullable: true 662 | uniqueClickOfRequest: 663 | type: integer 664 | format: int64 665 | description: "Number of users who opened this url through any link in the message. If a message contains two links to the same URL and a user opens both links, they're counted only once." 666 | nullable: true 667 | 668 | 669 | GetStatisticsPerUnitResponse: 670 | externalDocs: 671 | url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response 672 | description: "Response object for `get statistics per unit`" 673 | type: object 674 | properties: 675 | overview: 676 | $ref: "#/components/schemas/GetStatisticsPerUnitResponseOverview" 677 | messages: 678 | description: "Array of information about individual message bubbles." 679 | type: array 680 | items: 681 | $ref: "#/components/schemas/GetStatisticsPerUnitResponseMessage" 682 | clicks: 683 | description: "Array of information about opened URLs in the message." 684 | type: array 685 | items: 686 | $ref: "#/components/schemas/GetStatisticsPerUnitResponseClick" 687 | required: 688 | - clicks 689 | - messages 690 | - overview 691 | GetStatisticsPerUnitResponseOverview: 692 | description: "Statistics related to messages." 693 | externalDocs: 694 | url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response 695 | type: object 696 | properties: 697 | uniqueImpression: 698 | format: int64 699 | type: integer 700 | description: "Number of users who opened the message, meaning they displayed at least 1 bubble." 701 | nullable: true 702 | uniqueClick: 703 | format: int64 704 | type: integer 705 | description: "Number of users who opened any URL in the message." 706 | nullable: true 707 | uniqueMediaPlayed: 708 | format: int64 709 | type: integer 710 | description: "Number of users who started playing any video or audio in the message." 711 | nullable: true 712 | uniqueMediaPlayed100Percent: 713 | format: int64 714 | type: integer 715 | description: "Number of users who played the entirety of any video or audio in the message." 716 | nullable: true 717 | GetStatisticsPerUnitResponseMessage: 718 | externalDocs: 719 | url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response 720 | required: 721 | - seq 722 | type: object 723 | properties: 724 | seq: 725 | format: int32 726 | type: integer 727 | description: "Bubble's serial number." 728 | impression: 729 | format: int64 730 | type: integer 731 | description: "Number of times the bubble was displayed." 732 | nullable: true 733 | mediaPlayed: 734 | format: int64 735 | type: integer 736 | description: "Number of times audio or video in the bubble started playing." 737 | nullable: true 738 | mediaPlayed25Percent: 739 | format: int64 740 | type: integer 741 | description: "Number of times audio or video in the bubble started playing and was played 25% of the total time." 742 | nullable: true 743 | mediaPlayed50Percent: 744 | format: int64 745 | type: integer 746 | description: "Number of times audio or video in the bubble started playing and was played 50% of the total time." 747 | nullable: true 748 | mediaPlayed75Percent: 749 | format: int64 750 | type: integer 751 | description: "Number of times audio or video in the bubble started playing and was played 75% of the total time." 752 | nullable: true 753 | mediaPlayed100Percent: 754 | format: int64 755 | type: integer 756 | description: "Number of times audio or video in the bubble started playing and was played 100% of the total time." 757 | nullable: true 758 | uniqueImpression: 759 | format: int64 760 | type: integer 761 | description: "Number of users the bubble was displayed." 762 | nullable: true 763 | uniqueMediaPlayed: 764 | format: int64 765 | type: integer 766 | description: "Number of users that started playing audio or video in the bubble." 767 | nullable: true 768 | uniqueMediaPlayed25Percent: 769 | format: int64 770 | type: integer 771 | description: "Number of users that started playing audio or video in the bubble and played 25% of the total time." 772 | nullable: true 773 | uniqueMediaPlayed50Percent: 774 | format: int64 775 | type: integer 776 | description: "Number of users that started playing audio or video in the bubble and played 50% of the total time." 777 | nullable: true 778 | uniqueMediaPlayed75Percent: 779 | format: int64 780 | type: integer 781 | description: "Number of users that started playing audio or video in the bubble and played 75% of the total time." 782 | nullable: true 783 | uniqueMediaPlayed100Percent: 784 | format: int64 785 | type: integer 786 | description: "Number of users that started playing audio or video in the bubble and played 100% of the total time." 787 | nullable: true 788 | GetStatisticsPerUnitResponseClick: 789 | externalDocs: 790 | url: https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit-response 791 | type: object 792 | properties: 793 | seq: 794 | format: int64 795 | type: integer 796 | description: "The URL's serial number." 797 | url: 798 | type: string 799 | description: "URL." 800 | click: 801 | format: int64 802 | type: integer 803 | description: "Number of times the URL in the bubble was opened." 804 | nullable: true 805 | uniqueClick: 806 | format: int64 807 | type: integer 808 | description: "Number of users that opened the URL in the bubble." 809 | nullable: true 810 | uniqueClickOfRequest: 811 | format: int64 812 | type: integer 813 | description: |+ 814 | Number of users who opened this url through any link in the message. 815 | If another message bubble contains the same URL and a user opens both links, it's counted only once. 816 | nullable: true 817 | required: 818 | - seq 819 | - url 820 | 821 | ErrorResponse: 822 | externalDocs: 823 | url: https://developers.line.biz/en/reference/messaging-api/#error-responses 824 | type: object 825 | required: 826 | - message 827 | properties: 828 | message: 829 | type: string 830 | description: "Message containing information about the error." 831 | details: 832 | type: array 833 | items: 834 | $ref: "#/components/schemas/ErrorDetail" 835 | description: "An array of error details. If the array is empty, this property will not be included in the response." 836 | ErrorDetail: 837 | type: object 838 | properties: 839 | message: 840 | type: string 841 | description: "Details of the error. Not included in the response under certain situations." 842 | property: 843 | type: string 844 | description: "Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations." 845 | -------------------------------------------------------------------------------- /liff.yml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.2" 2 | info: 3 | title: LIFF server API 4 | version: "1.0.0" 5 | description: "LIFF Server API." 6 | 7 | servers: 8 | - url: https://api.line.me/ 9 | 10 | security: 11 | - Bearer: [] 12 | 13 | tags: 14 | - name: liff 15 | 16 | paths: 17 | "/liff/v1/apps": 18 | post: 19 | operationId: addLIFFApp 20 | externalDocs: 21 | url: https://developers.line.biz/en/reference/liff-server/#add-liff-app 22 | summary: "Create LIFF app" 23 | tags: 24 | - liff 25 | description: "Adding the LIFF app to a channel" 26 | requestBody: 27 | content: 28 | application/json: 29 | schema: 30 | "$ref": "#/components/schemas/AddLiffAppRequest" 31 | required: true 32 | responses: 33 | "200": 34 | description: "OK" 35 | content: 36 | "application/json": 37 | schema: 38 | $ref: "#/components/schemas/AddLiffAppResponse" 39 | example: 40 | liffId: "{liffId}" 41 | "400": 42 | description: |+ 43 | This status code means one of the following: 44 | - The request contains an invalid value. 45 | - The maximum number of LIFF apps that can be added to the channel has been reached. 46 | "401": 47 | description: |+ 48 | Authentication failed. 49 | 50 | get: 51 | operationId: getAllLIFFApps 52 | externalDocs: 53 | url: https://developers.line.biz/en/reference/liff-server/#get-all-liff-apps 54 | summary: "Get all LIFF apps" 55 | description: "Gets information on all the LIFF apps added to the channel." 56 | tags: 57 | - liff 58 | responses: 59 | "200": 60 | description: "OK" 61 | content: 62 | "application/json": 63 | schema: 64 | $ref: "#/components/schemas/GetAllLiffAppsResponse" 65 | example: 66 | apps: 67 | - liffId: "{liffId}" 68 | view: 69 | type: full 70 | url: https://example.com/myservice 71 | description: "Happy New York" 72 | permanentLinkPattern: concat 73 | - liffId: "{liffId}" 74 | view: 75 | type: tall 76 | url: https://example.com/myservice2 77 | features: 78 | ble: true 79 | qrCode: true 80 | permanentLinkPattern: concat 81 | scope: 82 | - profile 83 | - chat_message.write 84 | botPrompt: none 85 | "401": 86 | description: |+ 87 | Authentication failed. 88 | "404": 89 | description: |+ 90 | There is no LIFF app on the channel. 91 | 92 | 93 | 94 | "/liff/v1/apps/{liffId}": 95 | parameters: 96 | - name: liffId 97 | in: path 98 | required: true 99 | description: "ID of the LIFF app to be updated" 100 | schema: 101 | type: string 102 | put: 103 | operationId: updateLIFFApp 104 | externalDocs: 105 | url: https://developers.line.biz/en/reference/liff-server/#update-liff-app 106 | summary: "Update LIFF app from a channel" 107 | description: "Update LIFF app settings" 108 | tags: 109 | - liff 110 | requestBody: 111 | content: 112 | application/json: 113 | schema: 114 | "$ref": "#/components/schemas/UpdateLiffAppRequest" 115 | required: true 116 | responses: 117 | "200": 118 | description: "OK" 119 | "400": 120 | description: |+ 121 | The request contains an invalid value. 122 | "401": 123 | description: |+ 124 | Authentication failed. 125 | "404": 126 | description: |+ 127 | This status code means one of the following: 128 | - The specified LIFF app does not exist. 129 | - The specified LIFF app has been added to another channel. 130 | delete: 131 | operationId: deleteLIFFApp 132 | externalDocs: 133 | url: https://developers.line.biz/en/reference/liff-server/#delete-liff-app 134 | summary: "Delete LIFF app from a channel" 135 | description: |+ 136 | Deletes a LIFF app from a channel. 137 | tags: 138 | - liff 139 | responses: 140 | "200": 141 | description: "OK" 142 | "401": 143 | description: |+ 144 | Authentication failed. 145 | "404": 146 | description: |+ 147 | This status code means one of the following: 148 | - The specified LIFF app does not exist. 149 | - The specified LIFF app has been added to another channel. 150 | 151 | components: 152 | securitySchemes: 153 | Bearer: 154 | type: http 155 | scheme: bearer 156 | description: "Channel access token" 157 | 158 | schemas: 159 | AddLiffAppRequest: 160 | externalDocs: 161 | url: https://developers.line.biz/en/reference/liff-server/#add-liff-app 162 | type: object 163 | required: 164 | - view 165 | properties: 166 | view: 167 | $ref: "#/components/schemas/LiffView" 168 | description: 169 | type: string 170 | description: |+ 171 | Name of the LIFF app. 172 | 173 | The LIFF app name can't include "LINE" or similar strings, or inappropriate strings. 174 | features: 175 | $ref: "#/components/schemas/LiffFeatures" 176 | permanentLinkPattern: 177 | type: string 178 | description: |+ 179 | How additional information in LIFF URLs is handled. Specify `concat`. 180 | scope: 181 | type: array 182 | items: 183 | $ref: "#/components/schemas/LiffScope" 184 | botPrompt: 185 | $ref: "#/components/schemas/LiffBotPrompt" 186 | LiffBotPrompt: 187 | type: string 188 | description: |+ 189 | Specify the setting for bot link feature with one of the following values: 190 | 191 | `normal`: Display the option to add the LINE Official Account as a friend in the channel consent screen. 192 | `aggressive`: Display a screen with the option to add the LINE Official Account as a friend after the channel consent screen. 193 | `none`: Don't display the option to add the LINE Official Account as a friend. 194 | The default value is none. 195 | enum: 196 | - normal 197 | - aggressive 198 | - none 199 | LiffView: 200 | externalDocs: 201 | url: https://developers.line.biz/en/reference/liff-server/#add-liff-app 202 | type: object 203 | required: 204 | - type 205 | - url 206 | properties: 207 | type: 208 | description: |+ 209 | Size of the LIFF app view. Specify one of these values: 210 | - compact 211 | - tall 212 | - full 213 | type: string 214 | enum: 215 | - compact 216 | - tall 217 | - full 218 | url: 219 | type: string 220 | format: uri 221 | description: |+ 222 | Endpoint URL. This is the URL of the web app that implements the LIFF app 223 | (e.g. https://example.com). 224 | Used when the LIFF app is launched using the LIFF URL. 225 | The URL scheme must be https. URL fragments (#URL-fragment) can't be specified. 226 | moduleMode: 227 | type: boolean 228 | description: |+ 229 | `true` to use the LIFF app in modular mode. 230 | When in modular mode, the action button in the header is not displayed. 231 | UpdateLiffView: 232 | externalDocs: 233 | url: https://developers.line.biz/en/reference/liff-server/#update-liff-app 234 | type: object 235 | properties: 236 | type: 237 | description: |+ 238 | Size of the LIFF app view. Specify one of these values: 239 | - compact 240 | - tall 241 | - full 242 | type: string 243 | enum: 244 | - compact 245 | - tall 246 | - full 247 | url: 248 | type: string 249 | format: uri 250 | description: |+ 251 | Endpoint URL. This is the URL of the web app that implements the LIFF app 252 | (e.g. https://example.com). 253 | Used when the LIFF app is launched using the LIFF URL. 254 | The URL scheme must be https. URL fragments (#URL-fragment) can't be specified. 255 | moduleMode: 256 | type: boolean 257 | description: |+ 258 | `true` to use the LIFF app in modular mode. 259 | When in modular mode, the action button in the header is not displayed. 260 | LiffFeatures: 261 | type: object 262 | properties: 263 | ble: 264 | type: boolean 265 | description: |+ 266 | `true` if the LIFF app supports Bluetooth® Low Energy for LINE Things. `false` otherwise. 267 | qrCode: 268 | type: boolean 269 | description: |+ 270 | `true` to use the 2D code reader in the LIFF app. false otherwise. The default value is `false`. 271 | default: false 272 | 273 | AddLiffAppResponse: 274 | type: object 275 | required: 276 | - liffId 277 | properties: 278 | liffId: 279 | type: string 280 | 281 | UpdateLiffAppRequest: 282 | externalDocs: 283 | url: https://developers.line.biz/en/reference/liff-server/#add-liff-app 284 | type: object 285 | properties: 286 | view: 287 | $ref: "#/components/schemas/UpdateLiffView" 288 | description: 289 | type: string 290 | description: |+ 291 | Name of the LIFF app. 292 | 293 | The LIFF app name can't include "LINE" or similar strings, or inappropriate strings. 294 | features: 295 | $ref: "#/components/schemas/LiffFeatures" 296 | permanentLinkPattern: 297 | type: string 298 | description: |+ 299 | How additional information in LIFF URLs is handled. Specify `concat`. 300 | scope: 301 | type: array 302 | items: 303 | $ref: "#/components/schemas/LiffScope" 304 | botPrompt: 305 | $ref: "#/components/schemas/LiffBotPrompt" 306 | 307 | LiffScope: 308 | type: string 309 | enum: 310 | - openid 311 | - email 312 | - profile 313 | - chat_message.write 314 | description: |+ 315 | Array of scopes required for some LIFF SDK methods to function. 316 | The default value is `["profile", "chat_message.write"]`. 317 | 318 | GetAllLiffAppsResponse: 319 | type: object 320 | properties: 321 | apps: 322 | type: array 323 | items: 324 | $ref: "#/components/schemas/LiffApp" 325 | LiffApp: 326 | type: object 327 | properties: 328 | liffId: 329 | type: string 330 | description: "LIFF app ID" 331 | view: 332 | $ref: "#/components/schemas/LiffView" 333 | description: 334 | type: string 335 | description: "Name of the LIFF app" 336 | features: 337 | $ref: "#/components/schemas/LiffFeatures" 338 | permanentLinkPattern: 339 | type: string 340 | description: |+ 341 | How additional information in LIFF URLs is handled. concat is returned. 342 | scope: 343 | type: array 344 | items: 345 | $ref: "#/components/schemas/LiffScope" 346 | botPrompt: 347 | $ref: "#/components/schemas/LiffBotPrompt" 348 | -------------------------------------------------------------------------------- /module-attach.yml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.0 3 | info: 4 | title: LINE Messaging API 5 | version: "0.0.1" 6 | description: 7 | This document describes LINE Messaging API. 8 | 9 | servers: 10 | - url: "https://manager.line.biz" 11 | 12 | security: 13 | - basicAuth: [] 14 | 15 | tags: 16 | - name: line-module-attach 17 | 18 | paths: 19 | "/module/auth/v1/token": 20 | post: 21 | externalDocs: 22 | url: https://developers.line.biz/en/reference/partner-docs/#link-attach-by-operation-module-channel-provider 23 | tags: 24 | - line-module-attach 25 | operationId: attachModule 26 | description: "Attach by operation of the module channel provider" 27 | requestBody: 28 | required: true 29 | content: 30 | application/x-www-form-urlencoded: 31 | schema: 32 | description: "request of the attachModule" 33 | type: object 34 | properties: 35 | grant_type: 36 | type: string 37 | description: "authorization_code" 38 | example: authorization_code 39 | code: 40 | type: string 41 | description: "Authorization code received from the LINE Platform." 42 | redirect_uri: 43 | type: string 44 | description: "Specify the redirect_uri specified in the URL for authentication and authorization." 45 | code_verifier: 46 | type: string 47 | description: "Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks." 48 | client_id: 49 | type: string 50 | description: |+ 51 | Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. 52 | You can find the channel ID of the module channel in the LINE Developers Console. 53 | client_secret: 54 | type: string 55 | description: |+ 56 | Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. 57 | You can find the channel secret of the module channel in the LINE Developers Console. 58 | region: 59 | type: string 60 | description: |+ 61 | If you specified a value for region in the URL for authentication and authorization, specify the same value. 62 | basic_search_id: 63 | type: string 64 | description: "If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value." 65 | scope: 66 | type: string 67 | description: "If you specified a value for scope in the URL for authentication and authorization, specify the same value." 68 | brand_type: 69 | type: string 70 | description: "If you specified a value for brand_type in the URL for authentication and authorization, specify the same value." 71 | required: 72 | - grant_type 73 | - code 74 | - redirect_uri 75 | responses: 76 | "200": 77 | content: 78 | "application/json": 79 | schema: 80 | $ref: "#/components/schemas/AttachModuleResponse" 81 | example: 82 | bot_id: U45c5c51f0050ef0f0ee7261d57fd3c56 83 | scopes: 84 | - message:send 85 | - message:receive 86 | description: "OK" 87 | 88 | 89 | components: 90 | securitySchemes: 91 | basicAuth: 92 | type: http 93 | scheme: basic 94 | 95 | schemas: 96 | AttachModuleResponse: 97 | description: "Attach by operation of the module channel provider" 98 | required: 99 | - bot_id 100 | - scopes 101 | properties: 102 | bot_id: 103 | type: string 104 | description: "User ID of the bot on the LINE Official Account." 105 | scopes: 106 | type: array 107 | description: "Permissions (scope) granted by the LINE Official Account admin." 108 | items: 109 | type: string 110 | -------------------------------------------------------------------------------- /module.yml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.0 3 | info: 4 | title: LINE Messaging API 5 | version: "0.0.1" 6 | description: 7 | This document describes LINE Messaging API. 8 | 9 | servers: 10 | - url: "https://api.line.me" 11 | 12 | security: 13 | - Bearer: [] 14 | 15 | tags: 16 | - name: line-module 17 | 18 | paths: 19 | "/v2/bot/channel/detach": 20 | post: 21 | externalDocs: 22 | url: https://developers.line.biz/en/reference/partner-docs/#unlink-detach-module-channel-by-operation-mc-admin 23 | tags: 24 | - line-module 25 | operationId: detachModule 26 | description: "The module channel admin calls the Detach API to detach the module channel from a LINE Official Account." 27 | requestBody: 28 | content: 29 | application/json: 30 | schema: 31 | "$ref": "#/components/schemas/DetachModuleRequest" 32 | responses: 33 | "200": 34 | description: "OK" 35 | 36 | "/v2/bot/chat/{chatId}/control/acquire": 37 | post: 38 | externalDocs: 39 | url: https://developers.line.biz/en/reference/partner-docs/#acquire-control-api 40 | tags: 41 | - line-module 42 | operationId: acquireChatControl 43 | description: |+ 44 | If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. 45 | The channel that was previously an Active Channel will automatically switch to a Standby Channel. 46 | parameters: 47 | - name: chatId 48 | in: path 49 | required: true 50 | description: "The `userId`, `roomId`, or `groupId`" 51 | schema: 52 | type: string 53 | requestBody: 54 | content: 55 | application/json: 56 | schema: 57 | "$ref": "#/components/schemas/AcquireChatControlRequest" 58 | responses: 59 | "200": 60 | description: "OK" 61 | 62 | "/v2/bot/chat/{chatId}/control/release": 63 | post: 64 | externalDocs: 65 | url: https://developers.line.biz/en/reference/partner-docs/#release-control-api 66 | tags: 67 | - line-module 68 | operationId: releaseChatControl 69 | description: |+ 70 | To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. 71 | parameters: 72 | - name: chatId 73 | in: path 74 | required: true 75 | description: "The `userId`, `roomId`, or `groupId`" 76 | schema: 77 | type: string 78 | responses: 79 | "200": 80 | description: "OK" 81 | 82 | "/v2/bot/list": 83 | get: 84 | externalDocs: 85 | url: https://developers.line.biz/en/reference/partner-docs/#get-multiple-bot-info-api 86 | tags: 87 | - line-module 88 | operationId: getModules 89 | description: "Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels." 90 | parameters: 91 | - name: start 92 | in: query 93 | required: false 94 | description: |+ 95 | Value of the continuation token found in the next property of the JSON object returned in the response. 96 | If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. 97 | schema: 98 | type: string 99 | - name: limit 100 | in: query 101 | required: false 102 | description: |+ 103 | Specify the maximum number of bots that you get basic information from. The default value is 100. 104 | Max value: 100 105 | schema: 106 | type: integer 107 | format: int32 108 | default: 100 109 | maximum: 100 110 | responses: 111 | "200": 112 | description: "OK" 113 | content: 114 | "application/json": 115 | schema: 116 | "$ref": "#/components/schemas/GetModulesResponse" 117 | example: 118 | bots: 119 | - userId: Uf2dd6e8b081d2ff9c05c98a8a8b269c9 120 | basicId: "@628..." 121 | displayName: Test01 122 | pictureUrl: https://profile.line-scdn.net/0hyxytJNAlJldEDQzlatVZAHhIKDoz... 123 | - userId: Ua831d37bfe8232808202b85127663f70 124 | basicId: "@076lu..." 125 | displayName: Test02 126 | pictureUrl: https://profile.line-scdn.net/0hohnizdyzMEdTECbnVo9PEG9VPiok... 127 | - userId: Ub77ea431fba86f7c159a0c0f5be43d9f 128 | basicId: "@290n..." 129 | displayName: Test03 130 | - userId: Ub8ec80a14e879e9c6833fb4cee0e632b 131 | basicId: "@793j..." 132 | displayName: Test04 133 | 134 | 135 | components: 136 | securitySchemes: 137 | Bearer: 138 | type: http 139 | scheme: bearer 140 | description: "Channel access token" 141 | 142 | schemas: 143 | DetachModuleRequest: 144 | externalDocs: 145 | url: https://developers.line.biz/en/reference/partner-docs/#unlink-detach-module-channel-by-operation-mc-admin 146 | type: object 147 | description: "Unlink (detach) the module channel by the operation of the module channel administrator" 148 | properties: 149 | botId: 150 | description: "User ID of the LINE Official Account bot attached to the module channel." 151 | type: string 152 | AcquireChatControlRequest: 153 | externalDocs: 154 | url: https://developers.line.biz/en/reference/partner-docs/#acquire-control-api 155 | description: "Request entity of the Acquire Control API" 156 | type: object 157 | properties: 158 | expired: 159 | type: boolean 160 | description: |+ 161 | `True`: After the time limit (ttl) has passed, the initiative (Chat Control) will return to the Primary Channel. (Default) 162 | `False`: There's no time limit and the initiative (Chat Control) doesn't change over time. 163 | example: true 164 | ttl: 165 | type: integer 166 | format: int32 167 | # one year = 3600*24*365 168 | maximum: 31536000 169 | description: |+ 170 | The time it takes for initiative (Chat Control) to return to the Primary Channel (the time that the module channel stays on the Active Channel). 171 | The value is specified in seconds. The maximum value is one year (3600 * 24 * 365). 172 | The default value is 3600 (1 hour). 173 | 174 | * Ignored if the value of expired is false. 175 | example: 3600 176 | GetModulesResponse: 177 | externalDocs: 178 | url: https://developers.line.biz/en/reference/partner-docs/#get-multiple-bot-info-api 179 | description: "List of bots to which the module is attached" 180 | required: 181 | - bots 182 | type: object 183 | properties: 184 | bots: 185 | type: array 186 | items: 187 | "$ref": "#/components/schemas/ModuleBot" 188 | description: "Array of Bot list Item objects representing basic information about the bot." 189 | next: 190 | type: string 191 | description: |+ 192 | Continuation token. 193 | Used to get the next array of basic bot information. 194 | This property is only returned if there are more unreturned results. 195 | ModuleBot: 196 | externalDocs: 197 | url: https://developers.line.biz/en/reference/partner-docs/#get-multiple-bot-info-api 198 | description: "basic information about the bot." 199 | required: 200 | - userId 201 | - basicId 202 | - displayName 203 | type: object 204 | properties: 205 | userId: 206 | type: string 207 | description: "Bot's user ID" 208 | basicId: 209 | type: string 210 | description: "Bot's basic ID" 211 | premiumId: 212 | type: string 213 | description: "Bot's premium ID. Not included in the response if the premium ID isn't set." 214 | displayName: 215 | type: string 216 | description: "Bot's display name" 217 | pictureUrl: 218 | type: string 219 | description: "Profile image URL. Image URL starting with `https://`. Not included in the response if the bot doesn't have a profile image." 220 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "ibm-openapi-validator": "^0.97.5", 4 | "js-yaml": "^4.1.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended", 5 | "helpers:pinGitHubActionDigestsToSemver" 6 | ], 7 | "timezone": "Asia/Tokyo", 8 | "automerge": true, 9 | "platformAutomerge": true, 10 | } 11 | -------------------------------------------------------------------------------- /shop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.0 3 | info: 4 | title: Mission Stickers API 5 | version: "0.0.1" 6 | description: 7 | This document describes LINE Mission Stickers API. 8 | 9 | servers: 10 | - url: "https://api.line.me" 11 | 12 | security: 13 | - Bearer: [] 14 | 15 | tags: 16 | - name: shop 17 | 18 | paths: 19 | "/shop/v3/mission": 20 | post: 21 | externalDocs: 22 | url: https://developers.line.biz/en/reference/partner-docs/#send-mission-stickers-v3 23 | tags: 24 | - shop 25 | operationId: missionStickerV3 26 | description: "Sends a mission sticker." 27 | requestBody: 28 | content: 29 | application/json: 30 | schema: 31 | "$ref": "#/components/schemas/MissionStickerRequest" 32 | required: true 33 | responses: 34 | "200": 35 | description: "Returns status code 200 and an empty response body." 36 | # TODO content-type? 37 | 38 | components: 39 | securitySchemes: 40 | Bearer: 41 | type: http 42 | scheme: bearer 43 | description: "Channel access token" 44 | 45 | schemas: 46 | MissionStickerRequest: 47 | externalDocs: 48 | url: https://developers.line.biz/en/reference/partner-docs/#send-mission-stickers-v3 49 | description: "Send mission stickers (v3)" 50 | required: 51 | - to 52 | - productId 53 | - productType 54 | - sendPresentMessage 55 | type: object 56 | properties: 57 | to: 58 | type: string 59 | description: "Destination user ID" 60 | productId: 61 | type: string 62 | description: "Package ID for a set of stickers" 63 | productType: 64 | type: string 65 | description: "`STICKER`" 66 | example: STICKER 67 | sendPresentMessage: 68 | type: boolean 69 | description: "`false`" 70 | example: false 71 | 72 | ErrorResponse: 73 | externalDocs: 74 | url: https://developers.line.biz/en/reference/partner-docs/#send-mission-stickers-v3 75 | type: object 76 | required: 77 | - message 78 | properties: 79 | message: 80 | type: string 81 | description: "Message containing information about the error." 82 | 83 | -------------------------------------------------------------------------------- /tools/determine-change-type.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | 3 | 4 | // Call this script from the parent repository 5 | // This script determines the type of change to the parent repository 6 | // by checking the latest commit message and the status of the submodule. 7 | // The possible change types are: 8 | // - submodule-update: The submodule has been updated. 9 | // - other: The parent repository has been updated, but the submodule has not been updated. 10 | // The change type is printed to the console. 11 | 12 | const submoduleDir = "line-openapi"; 13 | 14 | async function determineChangeType() { 15 | // Get the latest commit message 16 | const { stdout: lastCommit } = await $`git log -1 --pretty=%s`; 17 | 18 | // Get the status of the submodule 19 | const { stdout: submoduleStatus } = await $`git submodule status ${submoduleDir}`; 20 | const hasUpdate = submoduleStatus.trim().startsWith('+'); 21 | 22 | // Determine the type of change 23 | if (lastCommit.includes(submoduleDir)) { 24 | console.log("submodule-update"); 25 | } else if (hasUpdate) { 26 | console.log("submodule-update"); 27 | } else { 28 | console.log("other"); 29 | } 30 | } 31 | 32 | await determineChangeType(); 33 | -------------------------------------------------------------------------------- /tools/generate-test.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | 3 | // https://github.com/OpenAPITools/openapi-generator/issues/13684 4 | process.env.JAVA_OPTS = '--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED'; 5 | 6 | for (let generator of ['java', 'kotlin', 'ruby', 'php', 'javascript', 'python']) { 7 | for (let ymlFile of globby.globbySync("*.yml")) { 8 | const basename = ymlFile.replace(".yml", ""); 9 | await $`openapi-generator generate -g ${generator} -i "${ymlFile}" -o tmp/${generator}/${basename}`; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tools/get-pr-info.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | 3 | import fs from "fs/promises"; 4 | 5 | 6 | // Call this script from the parent repository 7 | // This script generates a JSON file containing information about the latest PR 8 | // that updated the submodule. 9 | // The JSON file contains the following information: 10 | // - url: The URL of the PR. 11 | // - title: The title of the PR. 12 | // - body: The body of the PR. 13 | // The JSON file is saved as pr_info.json in the parent repository. 14 | 15 | const submoduleDir = "line-openapi"; 16 | const repo = "line/line-openapi"; 17 | 18 | async function generatePrInfo() { 19 | // Change to the submodule directory 20 | cd(submoduleDir); 21 | 22 | // Get the latest commit message in the submodule 23 | const { stdout: lastCommit } = await $`git log -1 --pretty=%s`; 24 | console.log("Last commit in submodule:", lastCommit.trim()); 25 | 26 | // Extract the PR number from the commit message 27 | const prNumberMatch = lastCommit.match(/#(\d+)/); 28 | if (!prNumberMatch) { 29 | console.error("No PR number found in submodule's latest commit. Exiting."); 30 | process.exit(1); 31 | } 32 | const prNumber = prNumberMatch[1]; 33 | console.log("Detected PR number:", prNumber); 34 | 35 | const prUrl = `https://github.com/${repo}/pull/${prNumber}`; 36 | console.log("Constructed PR URL:", prUrl); 37 | 38 | // Get the PR title and body 39 | const prInfo = JSON.parse(await $`gh pr view ${prNumber} --repo ${repo} --json title,body`); 40 | const prTitle = prInfo.title; 41 | const prBody = prInfo.body; 42 | 43 | // Save the PR information to a JSON file 44 | const output = { 45 | url: prUrl, 46 | title: prTitle, 47 | body: prBody, 48 | }; 49 | await fs.writeFile("../pr_info.json", JSON.stringify(output, null, 2)); 50 | console.log("PR information saved to pr_info.json"); 51 | 52 | // Return to the parent directory 53 | cd(".."); 54 | } 55 | 56 | await generatePrInfo(); 57 | -------------------------------------------------------------------------------- /tools/reformat.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | 3 | const fs = require('fs'); 4 | 5 | for (let ymlFile of globby.globbySync("*.yml")) { 6 | console.log(`Processing ${ymlFile}`); 7 | 8 | await convertSingleQuotesToDoubleQuotes(ymlFile); 9 | await trimTrailingWhitespace(ymlFile); 10 | } 11 | 12 | async function convertSingleQuotesToDoubleQuotes(ymlFile) { 13 | const content = fs.readFileSync(ymlFile, 'utf-8'); 14 | 15 | let dst = content.replace(/ '([^']+)'/g, ` "$1"`); 16 | dst = dst.replace(/ (\/[^:\n]+):/g, ` "$1":`); 17 | dst = dst.replace(/(description|summary): ([^|"'][^\n]+)/g, 18 | (m, key, val) => `${key}: "${val.replace(/"/g, '`')}"`); 19 | 20 | await fs.writeFileSync(ymlFile, dst); 21 | } 22 | 23 | 24 | async function trimTrailingWhitespace(ymlFile) { 25 | const content = await fs.readFileSync(ymlFile, "utf8"); 26 | 27 | const trimmedContent = content 28 | .split("\n") 29 | .map((line) => line.replace(/\s+$/, "")) 30 | .join("\n"); 31 | 32 | await fs.writeFileSync(ymlFile, trimmedContent, "utf8"); 33 | } 34 | -------------------------------------------------------------------------------- /tools/validate-all.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | 3 | for (let ymlFile of globby.globbySync("*.yml")) { 4 | await $`spectral lint "${ymlFile}" --ruleset=.spectral.yaml`; 5 | } 6 | -------------------------------------------------------------------------------- /tools/validate-inheritance.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | 3 | const fs = require('fs'); 4 | 5 | // All discriminator destination schemas should use `allOf` to inherit the parent class. 6 | for (let ymlFile of globby.globbySync("*.yml")) { 7 | console.log(`Processing ${ymlFile}`); 8 | const yml = YAML.parse(fs.readFileSync(ymlFile, {encoding: 'utf-8'})); 9 | for (let schemaName in yml['components']['schemas']) { 10 | const schemaBody = yml['components']['schemas'][schemaName]; 11 | const discriminators = schemaBody['discriminator']; 12 | if (discriminators) { 13 | for (const key of Object.values(discriminators['mapping'])) { 14 | const dstName = key.replace("#/components/schemas/", ""); 15 | const dstBody = yml['components']['schemas'][dstName]; 16 | if (!dstBody['allOf']) { 17 | console.log(dstName); 18 | } 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/validate-property-camelcase.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * validate-property-camelcase.mjs 5 | * 6 | * Usage: 7 | * node tools/validate-property-camelcase.mjs # diff-based check: only newly added keys against origin/main 8 | * node tools/validate-property-camelcase.mjs --full-scan # full-scan: check all keys in each OpenAPI file 9 | */ 10 | 11 | import { promises as fs } from 'fs'; 12 | import path from 'path'; 13 | import { execSync } from 'child_process'; 14 | import yaml from 'js-yaml'; 15 | 16 | /** 17 | * Recursively collect all files under the given directory 18 | * that have a .yml or .yaml extension, excluding certain directories. 19 | */ 20 | async function collectYamlFiles(dir) { 21 | const excludeDirs = new Set(['node_modules', '.github']); 22 | let results = []; 23 | const entries = await fs.readdir(dir, { withFileTypes: true }); 24 | for (const entry of entries) { 25 | const fullPath = path.join(dir, entry.name); 26 | if (entry.isDirectory() && excludeDirs.has(entry.name)) continue; 27 | if (entry.isDirectory()) { 28 | const sub = await collectYamlFiles(fullPath); 29 | results = results.concat(sub); 30 | } else if (entry.isFile() && /\.(ya?ml)$/i.test(entry.name)) { 31 | results.push(fullPath); 32 | } 33 | } 34 | return results; 35 | } 36 | 37 | /** 38 | * Parse the given YAML string into a JavaScript object. 39 | * Throws an error if parsing fails. 40 | */ 41 | function parseYaml(content) { 42 | try { 43 | return yaml.load(content) || {}; 44 | } catch (err) { 45 | throw new Error(`YAML parse error: ${err.message}`); 46 | } 47 | } 48 | 49 | /** 50 | * Return all property paths in the object as an array of strings. 51 | * Each path is in the form "parent.child.key". 52 | * Arrays are traversed, but their indices are not included in the paths. 53 | */ 54 | function getAllObjectPaths(obj, prefix = '') { 55 | if (obj === null || typeof obj !== 'object') return []; 56 | if (Array.isArray(obj)) { 57 | return obj.flatMap(item => getAllObjectPaths(item, prefix)); 58 | } 59 | let paths = []; 60 | for (const key of Object.keys(obj)) { 61 | const full = prefix ? `${prefix}.${key}` : key; 62 | paths.push(full); 63 | const child = obj[key]; 64 | if (child !== null && typeof child === 'object') { 65 | paths = paths.concat(getAllObjectPaths(child, full)); 66 | } 67 | } 68 | return paths; 69 | } 70 | 71 | /** 72 | * Compare the old and new objects and return an array of paths 73 | * that are present in newObj but not in oldObj. 74 | */ 75 | function getNewKeys(oldObj, newObj) { 76 | const oldSet = new Set(getAllObjectPaths(oldObj)); 77 | return getAllObjectPaths(newObj).filter(p => !oldSet.has(p)); 78 | } 79 | 80 | /** 81 | * Check if the object represents an OpenAPI definition. 82 | * Returns true if the root has an "openapi" property. 83 | */ 84 | function isOpenApi(obj) { 85 | return obj && typeof obj === 'object' && 86 | Object.prototype.hasOwnProperty.call(obj, 'openapi'); 87 | } 88 | 89 | async function main() { 90 | const args = process.argv.slice(2); 91 | const fullScan = args.includes('--full-scan'); 92 | 93 | // Use the current working directory 94 | const cwd = process.cwd(); 95 | const yamlFiles = await collectYamlFiles(cwd); 96 | let hasError = false; 97 | 98 | for (const filePath of yamlFiles) { 99 | const relPath = path.relative(cwd, filePath); 100 | console.log(`Processing ${relPath}`); 101 | 102 | // Read the new (HEAD) file content 103 | let newContent; 104 | try { 105 | newContent = await fs.readFile(filePath, 'utf8'); 106 | } catch { 107 | continue; 108 | } 109 | 110 | // Get the old file content from origin/main (empty if not present) 111 | let oldContent = ''; 112 | if (!fullScan) { 113 | try { 114 | oldContent = execSync(`git show origin/main:${relPath}`, { encoding: 'utf8' }); 115 | } catch { 116 | oldContent = ''; 117 | } 118 | } 119 | 120 | // Parse YAML contents 121 | let newObj, oldObj; 122 | try { 123 | newObj = parseYaml(newContent); 124 | oldObj = fullScan ? {} : parseYaml(oldContent); 125 | } catch (err) { 126 | console.warn(`Warning: parse error in ${relPath}: ${err.message}`); 127 | continue; 128 | } 129 | 130 | // Skip files that are not OpenAPI definitions 131 | if (!isOpenApi(newObj)) continue; 132 | 133 | // Determine keys to check: either full or diff 134 | const keysToCheck = fullScan 135 | ? getAllObjectPaths(newObj) 136 | : getNewKeys(oldObj, newObj); 137 | 138 | // Filter out example and x-www-form-urlencoded paths, then find underscores 139 | const invalid = keysToCheck.filter(p => { 140 | const last = p.split('.').pop(); 141 | if (/\.examples?\./.test(p)) return false; 142 | if (/x-www-form-urlencoded/.test(p)) return false; 143 | return last.includes('_'); 144 | }); 145 | 146 | if (invalid.length) { 147 | hasError = true; 148 | console.error(`\n[ERROR] ${relPath}: the following ${ 149 | fullScan ? 'keys' : 'newly added keys' 150 | } contain underscores:`); 151 | invalid.forEach(p => console.error(` - ${p}`)); 152 | console.error('[ERROR] You should change production code to use camelCase instead. ' + 153 | 'Especially, request body as JSON should be camelCase. line-bot-sdk-ruby depends on this. ' + 154 | 'However, You can ignore this if the defined class is not for JSON (like x-www-form-urlencoded), ' + 155 | 'or the class is for response body.'); 156 | } 157 | } 158 | 159 | if (hasError) { 160 | process.exit(1); 161 | } else { 162 | console.log(fullScan 163 | ? 'OK: No underscores found in OpenAPI keys (excluding examples and x-www-form-urlencoded).' 164 | : 'OK: No underscores found in newly added OpenAPI keys (excluding examples and x-www-form-urlencoded).' 165 | ); 166 | } 167 | } 168 | 169 | main(); 170 | -------------------------------------------------------------------------------- /tools/validate-request-suffix.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | 3 | const fs = require('fs'); 4 | 5 | let nonSuffixed = 0; 6 | 7 | // All request objects should have `Request` suffix. 8 | for (let ymlFile of globby.globbySync("*.yml")) { 9 | console.log(`# Processing ${ymlFile}`); 10 | const yml = YAML.parse(fs.readFileSync(ymlFile, {encoding: 'utf-8'})); 11 | for (let pathName in yml['paths']) { 12 | for (let pathObject of Object.values(yml['paths'][pathName])) { 13 | const requestBody = pathObject['requestBody']; 14 | if (requestBody && requestBody['content'] && requestBody['content']['application/json'] && requestBody['content']['application/json']['schema']) { 15 | const schema = requestBody['content']['application/json']['schema']; 16 | const ref = schema['$ref']; 17 | if (!ref.endsWith("Request")) { 18 | console.error(` Non "Request" suffixed request object was detected in ${pathName}: ${ref}`); 19 | nonSuffixed += 1; 20 | } 21 | } 22 | } 23 | } 24 | } 25 | 26 | if (nonSuffixed > 0 ) { 27 | console.error("There's non-Request suffixed request object."); 28 | process.exit(1); 29 | } 30 | -------------------------------------------------------------------------------- /webhook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | openapi: 3.0.3 3 | info: 4 | title: Webhook Type Definition 5 | description: "Webhook event definition of the LINE Messaging API" 6 | version: 1.0.0 7 | servers: 8 | # DUMMY 9 | - url: "https://example.com" 10 | 11 | tags: 12 | - name: dummy 13 | 14 | # openapi-generator doesn't support OpenAPI 3's webhook. 15 | # https://github.com/OpenAPITools/openapi-generator/issues/6689 16 | # https://github.com/OpenAPITools/openapi-generator/issues/9083 17 | paths: 18 | "/callback": 19 | post: 20 | operationId: callback 21 | tags: 22 | - dummy 23 | description: "This is the dummy endpoint to generate the model classes" 24 | requestBody: 25 | required: true 26 | content: 27 | application/json: 28 | schema: 29 | $ref: "#/components/schemas/CallbackRequest" 30 | responses: 31 | "200": 32 | description: "OK" 33 | content: 34 | application/json: 35 | schema: 36 | description: "dummy response" 37 | type: string 38 | example: OK 39 | 40 | 41 | components: 42 | schemas: 43 | CallbackRequest: 44 | externalDocs: 45 | url: https://developers.line.biz/en/reference/messaging-api/#request-body 46 | description: |+ 47 | The request body contains a JSON object with the user ID of a bot that should receive webhook events and an array of webhook event objects. 48 | type: object 49 | required: 50 | - destination 51 | - events 52 | properties: 53 | destination: 54 | type: string 55 | description: |+ 56 | User ID of a bot that should receive webhook events. 57 | The user ID value is a string that matches the regular expression, `U[0-9a-f]{32}`. 58 | pattern: "^U[0-9a-f]{32}$" 59 | maxLength: 33 60 | minLength: 33 61 | events: 62 | description: |+ 63 | Array of webhook event objects. 64 | The LINE Platform may send an empty array that doesn't include a webhook event object to confirm communication. 65 | type: array 66 | items: 67 | $ref: "#/components/schemas/Event" 68 | 69 | Event: 70 | description: "Webhook event" 71 | required: 72 | - type 73 | - timestamp 74 | - mode 75 | - webhookEventId 76 | - deliveryContext 77 | type: object 78 | properties: 79 | type: 80 | type: string 81 | description: "Type of the event" 82 | source: 83 | $ref: "#/components/schemas/Source" 84 | timestamp: 85 | type: integer 86 | format: int64 87 | description: "Time of the event in milliseconds." 88 | mode: 89 | $ref: "#/components/schemas/EventMode" 90 | webhookEventId: 91 | type: string 92 | description: "Webhook Event ID. An ID that uniquely identifies a webhook event. This is a string in ULID format." 93 | deliveryContext: 94 | $ref: "#/components/schemas/DeliveryContext" 95 | discriminator: 96 | propertyName: type 97 | mapping: 98 | message: "#/components/schemas/MessageEvent" 99 | unsend: "#/components/schemas/UnsendEvent" 100 | follow: "#/components/schemas/FollowEvent" 101 | unfollow: "#/components/schemas/UnfollowEvent" 102 | join: "#/components/schemas/JoinEvent" 103 | leave: "#/components/schemas/LeaveEvent" 104 | memberJoined: "#/components/schemas/MemberJoinedEvent" 105 | memberLeft: "#/components/schemas/MemberLeftEvent" 106 | postback: "#/components/schemas/PostbackEvent" 107 | videoPlayComplete: "#/components/schemas/VideoPlayCompleteEvent" 108 | beacon: "#/components/schemas/BeaconEvent" 109 | accountLink: "#/components/schemas/AccountLinkEvent" 110 | things: "#/components/schemas/ThingsEvent" 111 | membership: "#/components/schemas/MembershipEvent" 112 | module: "#/components/schemas/ModuleEvent" 113 | activated: "#/components/schemas/ActivatedEvent" 114 | deactivated: "#/components/schemas/DeactivatedEvent" 115 | botSuspended: "#/components/schemas/BotSuspendedEvent" 116 | botResumed: "#/components/schemas/BotResumedEvent" 117 | delivery: "#/components/schemas/PnpDeliveryCompletionEvent" 118 | 119 | EventMode: 120 | type: string 121 | description: "Channel state." 122 | enum: [active, standby] 123 | 124 | DeliveryContext: 125 | type: object 126 | description: "webhook's delivery context information" 127 | required: 128 | - isRedelivery 129 | properties: 130 | isRedelivery: 131 | type: boolean 132 | description: "Whether the webhook event is a redelivered one or not." 133 | 134 | 135 | Source: 136 | externalDocs: 137 | url: https://developers.line.biz/en/reference/messaging-api/#source-user 138 | description: "the source of the event." 139 | required: 140 | - type 141 | type: object 142 | properties: 143 | type: 144 | type: string 145 | description: "source type" 146 | discriminator: 147 | propertyName: type 148 | mapping: 149 | user: "#/components/schemas/UserSource" 150 | group: "#/components/schemas/GroupSource" 151 | room: "#/components/schemas/RoomSource" 152 | UserSource: 153 | allOf: 154 | - $ref: "#/components/schemas/Source" 155 | - type: object 156 | required: 157 | - type 158 | properties: 159 | userId: 160 | type: string 161 | description: "ID of the source user" 162 | GroupSource: 163 | allOf: 164 | - $ref: "#/components/schemas/Source" 165 | - type: object 166 | required: 167 | - type 168 | - groupId 169 | properties: 170 | groupId: 171 | type: string 172 | description: "Group ID of the source group chat" 173 | userId: 174 | type: string 175 | description: "ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId." 176 | RoomSource: 177 | allOf: 178 | - $ref: "#/components/schemas/Source" 179 | - type: object 180 | required: 181 | - type 182 | - roomId 183 | description: "Source multi-person chat" 184 | properties: 185 | userId: 186 | type: string 187 | description: "ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId." 188 | roomId: 189 | type: string 190 | description: "Room ID of the source multi-person chat" 191 | 192 | 193 | # https://developers.line.biz/en/reference/messaging-api/#message-event 194 | MessageEvent: 195 | description: "Webhook event object which contains the sent message." 196 | type: object 197 | allOf: 198 | - $ref: "#/components/schemas/Event" 199 | - type: object 200 | required: 201 | - type 202 | - message 203 | properties: 204 | replyToken: 205 | type: string 206 | message: 207 | $ref: "#/components/schemas/MessageContent" 208 | 209 | MessageContent: 210 | externalDocs: 211 | url: https://developers.line.biz/en/reference/messaging-api/#message-event 212 | type: object 213 | required: 214 | - type 215 | - id 216 | properties: 217 | type: 218 | type: string 219 | description: "Type" 220 | id: 221 | type: string 222 | description: "Message ID" 223 | discriminator: 224 | propertyName: type 225 | mapping: 226 | text: "#/components/schemas/TextMessageContent" 227 | image: "#/components/schemas/ImageMessageContent" 228 | video: "#/components/schemas/VideoMessageContent" 229 | audio: "#/components/schemas/AudioMessageContent" 230 | file: "#/components/schemas/FileMessageContent" 231 | location: "#/components/schemas/LocationMessageContent" 232 | sticker: "#/components/schemas/StickerMessageContent" 233 | ContentProvider: 234 | description: "Provider of the media file." 235 | required: 236 | - type 237 | type: object 238 | properties: 239 | type: 240 | type: string 241 | description: "Provider of the image file." 242 | enum: 243 | - line 244 | - external 245 | originalContentUrl: 246 | type: string 247 | format: uri 248 | description: "URL of the image file. Only included when contentProvider.type is external." 249 | previewImageUrl: 250 | format: uri 251 | type: string 252 | description: "URL of the preview image. Only included when contentProvider.type is external." 253 | TextMessageContent: 254 | allOf: 255 | - $ref: "#/components/schemas/MessageContent" 256 | - type: object 257 | required: 258 | - text 259 | - quoteToken 260 | properties: 261 | text: 262 | type: string 263 | description: "Message text." 264 | emojis: 265 | description: "Array of one or more LINE emoji objects. Only included in the message event when the text property contains a LINE emoji." 266 | type: array 267 | items: 268 | $ref: "#/components/schemas/Emoji" 269 | mention: 270 | $ref: "#/components/schemas/Mention" 271 | quoteToken: 272 | type: string 273 | description: |+ 274 | Quote token to quote this message. 275 | quotedMessageId: 276 | type: string 277 | description: "Message ID of a quoted message. Only included when the received message quotes a past message." 278 | Emoji: 279 | required: 280 | - index 281 | - length 282 | - productId 283 | - emojiId 284 | type: object 285 | properties: 286 | index: 287 | type: integer 288 | description: "Index position for a character in text, with the first character being at position 0." 289 | length: 290 | type: integer 291 | description: "The length of the LINE emoji string. For LINE emoji (hello), 7 is the length." 292 | productId: 293 | type: string 294 | description: "Product ID for a LINE emoji set." 295 | emojiId: 296 | type: string 297 | description: "ID for a LINE emoji inside a set." 298 | Mention: 299 | required: 300 | - mentionees 301 | type: object 302 | properties: 303 | mentionees: 304 | description: "Array of one or more mention objects. Max: 20 mentions" 305 | type: array 306 | items: 307 | $ref: "#/components/schemas/Mentionee" 308 | Mentionee: 309 | externalDocs: 310 | url: https://developers.line.biz/en/reference/messaging-api/#wh-text 311 | required: 312 | - type 313 | - index 314 | - length 315 | type: object 316 | properties: 317 | type: 318 | type: string 319 | description: "Mentioned target." 320 | index: 321 | type: integer 322 | format: int32 323 | description: "Index position of the user mention for a character in text, with the first character being at position 0." 324 | length: 325 | type: integer 326 | format: int32 327 | description: "The length of the text of the mentioned user. For a mention @example, 8 is the length." 328 | discriminator: 329 | propertyName: type 330 | mapping: 331 | user: "#/components/schemas/UserMentionee" 332 | all: "#/components/schemas/AllMentionee" 333 | UserMentionee: 334 | description: "Mentioned target is user" 335 | allOf: 336 | - $ref: "#/components/schemas/Mentionee" 337 | - type: object 338 | properties: 339 | userId: 340 | type: string 341 | description: "User ID of the mentioned user. Only included if mention.mentions[].type is user and the user consents to the LINE Official Account obtaining their user profile information." 342 | isSelf: 343 | type: boolean 344 | description: "Whether the mentioned user is the bot that receives the webhook." 345 | AllMentionee: 346 | description: "Mentioned target is entire group" 347 | allOf: 348 | - $ref: "#/components/schemas/Mentionee" 349 | - type: object 350 | ImageMessageContent: 351 | allOf: 352 | - $ref: "#/components/schemas/MessageContent" 353 | - type: object 354 | required: 355 | - contentProvider 356 | - quoteToken 357 | properties: 358 | contentProvider: 359 | $ref: "#/components/schemas/ContentProvider" 360 | imageSet: 361 | $ref: "#/components/schemas/ImageSet" 362 | quoteToken: 363 | type: string 364 | description: |+ 365 | Quote token to quote this message. 366 | ImageSet: 367 | type: object 368 | required: 369 | - id 370 | properties: 371 | id: 372 | type: string 373 | description: "Image set ID. Only included when multiple images are sent simultaneously." 374 | index: 375 | type: integer 376 | description: "An index starting from 1, indicating the image number in a set of images sent simultaneously. Only included when multiple images are sent simultaneously. However, it won't be included if the sender is using LINE 11.15 or earlier for Android." 377 | total: 378 | type: integer 379 | description: "The total number of images sent simultaneously." 380 | 381 | VideoMessageContent: 382 | allOf: 383 | - $ref: "#/components/schemas/MessageContent" 384 | - type: object 385 | required: 386 | - contentProvider 387 | - quoteToken 388 | description: "Message object which contains the video content sent from the source. The preview image is displayed in the chat and the video is played when the image is tapped." 389 | properties: 390 | duration: 391 | type: integer 392 | format: int64 393 | description: "Length of video file (milliseconds)" 394 | contentProvider: 395 | $ref: "#/components/schemas/ContentProvider" 396 | quoteToken: 397 | type: string 398 | description: |+ 399 | Quote token to quote this message. 400 | AudioMessageContent: 401 | allOf: 402 | - $ref: "#/components/schemas/MessageContent" 403 | - type: object 404 | required: 405 | - contentProvider 406 | description: "Message object which contains the audio content sent from the source." 407 | properties: 408 | contentProvider: 409 | $ref: "#/components/schemas/ContentProvider" 410 | duration: 411 | type: integer 412 | format: int64 413 | description: "Length of audio file (milliseconds)" 414 | FileMessageContent: 415 | allOf: 416 | - $ref: "#/components/schemas/MessageContent" 417 | - type: object 418 | required: 419 | - fileName 420 | - fileSize 421 | description: "Message object which contains the file sent from the source." 422 | properties: 423 | fileName: 424 | type: string 425 | description: "File name" 426 | fileSize: 427 | type: integer 428 | description: "File size in bytes" 429 | LocationMessageContent: 430 | allOf: 431 | - $ref: "#/components/schemas/MessageContent" 432 | - type: object 433 | required: 434 | - latitude 435 | - longitude 436 | description: "Message object which contains the location data sent from the source." 437 | properties: 438 | title: 439 | type: string 440 | description: "Title" 441 | address: 442 | type: string 443 | description: "Address" 444 | latitude: 445 | type: number 446 | format: double 447 | description: "Latitude" 448 | longitude: 449 | type: number 450 | format: double 451 | description: "Longitude" 452 | StickerMessageContent: 453 | externalDocs: 454 | url: https://developers.line.biz/en/reference/messaging-api/#wh-sticker 455 | allOf: 456 | - $ref: "#/components/schemas/MessageContent" 457 | - type: object 458 | required: 459 | - packageId 460 | - stickerId 461 | - stickerResourceType 462 | - quoteToken 463 | description: "Message object which contains the sticker data sent from the source." 464 | properties: 465 | packageId: 466 | type: string 467 | description: "Package ID" 468 | stickerId: 469 | type: string 470 | description: "Sticker ID" 471 | stickerResourceType: 472 | type: string 473 | enum: 474 | - STATIC 475 | - ANIMATION 476 | - SOUND 477 | - ANIMATION_SOUND 478 | - POPUP 479 | - POPUP_SOUND 480 | - CUSTOM 481 | - MESSAGE 482 | - NAME_TEXT 483 | - PER_STICKER_TEXT 484 | keywords: 485 | # This field is experimental. 486 | type: array 487 | maxItems: 15 488 | items: 489 | type: string 490 | description: |+ 491 | Array of up to 15 keywords describing the sticker. 492 | If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. 493 | The keyword selection is random for each event, so different keywords may be returned for the same sticker. 494 | text: 495 | type: string 496 | description: |+ 497 | Any text entered by the user. This property is only included for message stickers. 498 | Max character limit: 100 499 | maxLength: 100 500 | quoteToken: 501 | type: string 502 | description: |+ 503 | Quote token to quote this message. 504 | quotedMessageId: 505 | type: string 506 | description: |+ 507 | Message ID of a quoted message. Only included when the received message quotes a past message. 508 | 509 | # https://developers.line.biz/en/reference/messaging-api/#unsend-event 510 | UnsendEvent: 511 | description: "Event object for when the user unsends a message." 512 | allOf: 513 | - $ref: "#/components/schemas/Event" 514 | - type: object 515 | required: 516 | - unsend 517 | properties: 518 | unsend: 519 | "$ref": "#/components/schemas/UnsendDetail" 520 | UnsendDetail: 521 | required: 522 | - messageId 523 | type: object 524 | properties: 525 | messageId: 526 | type: string 527 | description: "The message ID of the unsent message" 528 | 529 | 530 | # https://developers.line.biz/en/reference/messaging-api/#follow-event 531 | FollowEvent: 532 | description: "Event object for when your LINE Official Account is added as a friend (or unblocked). You can reply to follow events." 533 | allOf: 534 | - $ref: "#/components/schemas/Event" 535 | - type: object 536 | required: 537 | - replyToken 538 | - follow 539 | properties: 540 | replyToken: 541 | type: string 542 | description: "Reply token used to send reply message to this event" 543 | follow: 544 | "$ref": "#/components/schemas/FollowDetail" 545 | FollowDetail: 546 | type: object 547 | required: 548 | - isUnblocked 549 | properties: 550 | isUnblocked: 551 | type: boolean 552 | description: "Whether a user has added your LINE Official Account as a friend or unblocked." 553 | 554 | 555 | # https://developers.line.biz/en/reference/messaging-api/#unfollow-event 556 | UnfollowEvent: 557 | description: "Event object for when your LINE Official Account is blocked." 558 | allOf: 559 | - $ref: "#/components/schemas/Event" 560 | - type: object 561 | 562 | 563 | # https://developers.line.biz/en/reference/messaging-api/#join-event 564 | JoinEvent: 565 | description: "Event object for when your LINE Official Account joins a group chat or multi-person chat. You can reply to join events." 566 | allOf: 567 | - $ref: "#/components/schemas/Event" 568 | - type: object 569 | required: 570 | - replyToken 571 | properties: 572 | replyToken: 573 | type: string 574 | description: "Reply token used to send reply message to this event" 575 | 576 | 577 | # https://developers.line.biz/en/reference/messaging-api/#leave-event 578 | LeaveEvent: 579 | description: "Event object for when a user removes your LINE Official Account from a group chat or when your LINE Official Account leaves a group chat or multi-person chat." 580 | allOf: 581 | - $ref: "#/components/schemas/Event" 582 | - type: object 583 | 584 | 585 | # https://developers.line.biz/en/reference/messaging-api/#member-joined-event 586 | MemberJoinedEvent: 587 | description: "Event object for when a user joins a group chat or multi-person chat that the LINE Official Account is in." 588 | allOf: 589 | - $ref: "#/components/schemas/Event" 590 | - type: object 591 | required: 592 | - replyToken 593 | - joined 594 | properties: 595 | replyToken: 596 | type: string 597 | description: "Reply token used to send reply message to this event" 598 | joined: 599 | $ref: "#/components/schemas/JoinedMembers" 600 | JoinedMembers: 601 | required: 602 | - members 603 | type: object 604 | properties: 605 | members: 606 | description: "Users who joined. Array of source user objects." 607 | type: array 608 | items: 609 | $ref: "#/components/schemas/UserSource" 610 | 611 | 612 | # https://developers.line.biz/en/reference/messaging-api/#member-left-event 613 | MemberLeftEvent: 614 | description: "Event object for when a user leaves a group chat or multi-person chat that the LINE Official Account is in." 615 | allOf: 616 | - $ref: "#/components/schemas/Event" 617 | - type: object 618 | required: 619 | - left 620 | properties: 621 | left: 622 | $ref: "#/components/schemas/LeftMembers" 623 | LeftMembers: 624 | required: 625 | - members 626 | type: object 627 | properties: 628 | members: 629 | description: "Users who left. Array of source user objects." 630 | type: array 631 | items: 632 | $ref: "#/components/schemas/UserSource" 633 | 634 | 635 | # https://developers.line.biz/en/reference/messaging-api/#postback-event 636 | PostbackEvent: 637 | description: "Event object for when a user performs a postback action which initiates a postback. You can reply to postback events." 638 | allOf: 639 | - $ref: "#/components/schemas/Event" 640 | - type: object 641 | required: 642 | - postback 643 | properties: 644 | replyToken: 645 | type: string 646 | description: "Reply token used to send reply message to this event" 647 | postback: 648 | $ref: "#/components/schemas/PostbackContent" 649 | PostbackContent: 650 | type: object 651 | required: 652 | - data 653 | properties: 654 | data: 655 | type: string 656 | description: "Postback data" 657 | params: 658 | type: object 659 | additionalProperties: 660 | type: string 661 | 662 | 663 | # https://developers.line.biz/en/reference/messaging-api/#video-viewing-complete 664 | VideoPlayCompleteEvent: 665 | description: "Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE Official Account." 666 | allOf: 667 | - $ref: "#/components/schemas/Event" 668 | - type: object 669 | required: 670 | - replyToken 671 | - videoPlayComplete 672 | properties: 673 | replyToken: 674 | type: string 675 | description: "Reply token used to send reply message to this event" 676 | videoPlayComplete: 677 | $ref: "#/components/schemas/VideoPlayComplete" 678 | VideoPlayComplete: 679 | required: 680 | - trackingId 681 | type: object 682 | properties: 683 | trackingId: 684 | type: string 685 | description: "ID used to identify a video. Returns the same value as the trackingId assigned to the video message." 686 | 687 | 688 | # https://developers.line.biz/en/reference/messaging-api/#beacon-event 689 | BeaconEvent: 690 | description: "Event object for when a user enters the range of a LINE Beacon. You can reply to beacon events." 691 | allOf: 692 | - $ref: "#/components/schemas/Event" 693 | - type: object 694 | required: 695 | - replyToken 696 | - beacon 697 | properties: 698 | replyToken: 699 | type: string 700 | description: "Reply token used to send reply message to this event" 701 | beacon: 702 | $ref: "#/components/schemas/BeaconContent" 703 | BeaconContent: 704 | required: 705 | - hwid 706 | - type 707 | type: object 708 | properties: 709 | hwid: 710 | type: string 711 | description: "Hardware ID of the beacon that was detected" 712 | type: 713 | type: string 714 | description: "Type of beacon event." 715 | enum: [enter, banner, stay] 716 | dm: 717 | type: string 718 | description: "Device message of beacon that was detected." 719 | 720 | 721 | # https://developers.line.biz/en/reference/messaging-api/#account-link-event 722 | AccountLinkEvent: 723 | description: "Event object for when a user has linked their LINE account with a provider's service account. You can reply to account link events." 724 | allOf: 725 | - $ref: "#/components/schemas/Event" 726 | - type: object 727 | required: 728 | - link 729 | properties: 730 | replyToken: 731 | type: string 732 | description: "Reply token used to send reply message to this event. This property won't be included if linking the account has failed." 733 | link: 734 | $ref: "#/components/schemas/LinkContent" 735 | LinkContent: 736 | description: "Content of the account link event." 737 | required: 738 | - result 739 | - nonce 740 | type: object 741 | properties: 742 | result: 743 | type: string 744 | enum: [ok, failed] 745 | description: "One of the following values to indicate whether linking the account was successful or not" 746 | nonce: 747 | type: string 748 | description: "Specified nonce (number used once) when verifying the user ID." 749 | 750 | 751 | # https://developers.line.biz/en/reference/messaging-api/#scenario-result-event 752 | ThingsEvent: 753 | description: "Indicates that a user linked a device with LINE." 754 | allOf: 755 | - $ref: "#/components/schemas/Event" 756 | - type: object 757 | required: 758 | - replyToken 759 | - things 760 | properties: 761 | replyToken: 762 | type: string 763 | description: "Reply token used to send reply message to this event" 764 | things: 765 | $ref: "#/components/schemas/ThingsContent" 766 | 767 | ThingsContent: 768 | type: object 769 | required: 770 | - type 771 | properties: 772 | type: 773 | type: string 774 | description: "Type" 775 | discriminator: 776 | propertyName: type 777 | mapping: 778 | link: "#/components/schemas/LinkThingsContent" 779 | unlink: "#/components/schemas/UnlinkThingsContent" 780 | scenarioResult: "#/components/schemas/ScenarioResultThingsContent" 781 | LinkThingsContent: 782 | allOf: 783 | - $ref: "#/components/schemas/ThingsContent" 784 | - type: object 785 | required: 786 | - deviceId 787 | description: "Indicates that a user linked a device with LINE." 788 | properties: 789 | deviceId: 790 | type: string 791 | description: "Device ID of the device that has been linked with LINE." 792 | UnlinkThingsContent: 793 | allOf: 794 | - $ref: "#/components/schemas/ThingsContent" 795 | - type: object 796 | required: 797 | - deviceId 798 | description: "Indicates that the user unlinked a device from LINE." 799 | properties: 800 | deviceId: 801 | type: string 802 | description: "Device ID of the device that has been linked with LINE." 803 | ScenarioResultThingsContent: 804 | allOf: 805 | - $ref: "#/components/schemas/ThingsContent" 806 | - type: object 807 | required: 808 | - deviceId 809 | - result 810 | description: "This event indicates that an automatic communication scenario has been executed." 811 | properties: 812 | deviceId: 813 | type: string 814 | description: "Device ID of the device that has been linked with LINE." 815 | result: 816 | $ref: "#/components/schemas/ScenarioResult" 817 | ScenarioResult: 818 | externalDocs: 819 | url: https://developers.line.biz/en/reference/messaging-api/#scenario-result-event 820 | required: 821 | - startTime 822 | - endTime 823 | - resultCode 824 | type: object 825 | properties: 826 | scenarioId: 827 | type: string 828 | description: "Scenario ID executed" 829 | revision: 830 | type: integer 831 | description: "Revision number of the scenario set containing the executed scenario" 832 | startTime: 833 | type: integer 834 | format: int64 835 | description: "Timestamp for when execution of scenario action started (milliseconds, LINE app time)" 836 | endTime: 837 | type: integer 838 | format: int64 839 | description: "Timestamp for when execution of scenario was completed (milliseconds, LINE app time)" 840 | resultCode: 841 | type: string 842 | description: "Scenario execution completion status" 843 | actionResults: 844 | description: "Execution result of individual operations specified in action. Only included when things.result.resultCode is success." 845 | type: array 846 | items: 847 | $ref: "#/components/schemas/ActionResult" 848 | bleNotificationPayload: 849 | description: "Data contained in notification." 850 | type: string 851 | errorReason: 852 | description: "Error reason." 853 | type: string 854 | ActionResult: 855 | required: 856 | - type 857 | type: object 858 | properties: 859 | type: 860 | type: string 861 | enum: [ void, binary ] 862 | data: 863 | description: "Base64-encoded binary data" 864 | type: string 865 | 866 | # https://developers.line.biz/en/reference/messaging-api/#membership-event 867 | MembershipEvent: 868 | description: "This event indicates that a user has subscribed (joined), unsubscribed (left), or renewed the bot's membership." 869 | allOf: 870 | - $ref: "#/components/schemas/Event" 871 | - type: object 872 | required: 873 | - replyToken 874 | - membership 875 | properties: 876 | replyToken: 877 | type: string 878 | description: "Reply token used to send reply message to this event" 879 | membership: 880 | $ref: "#/components/schemas/MembershipContent" 881 | MembershipContent: 882 | description: "Content of the membership event." 883 | required: 884 | - type 885 | - membershipId 886 | type: object 887 | properties: 888 | type: 889 | type: string 890 | description: "Type of membership event." 891 | discriminator: 892 | propertyName: type 893 | mapping: 894 | joined: "#/components/schemas/JoinedMembershipContent" 895 | left: "#/components/schemas/LeftMembershipContent" 896 | renewed: "#/components/schemas/RenewedMembershipContent" 897 | JoinedMembershipContent: 898 | allOf: 899 | - $ref: "#/components/schemas/MembershipContent" 900 | - type: object 901 | required: 902 | - membershipId 903 | properties: 904 | membershipId: 905 | type: integer 906 | description: "The ID of the membership that the user joined. This is defined for each membership." 907 | LeftMembershipContent: 908 | allOf: 909 | - $ref: "#/components/schemas/MembershipContent" 910 | - type: object 911 | required: 912 | - membershipId 913 | properties: 914 | membershipId: 915 | type: integer 916 | description: "The ID of the membership that the user left. This is defined for each membership." 917 | RenewedMembershipContent: 918 | allOf: 919 | - $ref: "#/components/schemas/MembershipContent" 920 | - type: object 921 | required: 922 | - membershipId 923 | properties: 924 | membershipId: 925 | type: integer 926 | description: "The ID of the membership that the user renewed. This is defined for each membership." 927 | 928 | # https://developers.line.biz/en/reference/partner-docs/#module-webhook-event-object 929 | ModuleEvent: 930 | description: "This event indicates that the module channel has been attached to the LINE Official Account. Sent to the webhook URL server of the module channel." 931 | allOf: 932 | - $ref: "#/components/schemas/Event" 933 | - type: object 934 | required: 935 | - module 936 | properties: 937 | module: 938 | $ref: "#/components/schemas/ModuleContent" 939 | ModuleContent: 940 | type: object 941 | required: 942 | - type 943 | properties: 944 | type: 945 | type: string 946 | description: "Type" 947 | discriminator: 948 | propertyName: type 949 | mapping: 950 | attached: "#/components/schemas/AttachedModuleContent" 951 | detached: "#/components/schemas/DetachedModuleContent" 952 | AttachedModuleContent: 953 | allOf: 954 | - $ref: "#/components/schemas/ModuleContent" 955 | - type: object 956 | required: 957 | - botId 958 | - scopes 959 | properties: 960 | botId: 961 | description: "User ID of the bot on the attached LINE Official Account" 962 | type: string 963 | scopes: 964 | description: "An array of strings indicating the scope permitted by the admin of the LINE Official Account." 965 | type: array 966 | items: 967 | type: string 968 | DetachedModuleContent: 969 | allOf: 970 | - $ref: "#/components/schemas/ModuleContent" 971 | - type: object 972 | required: 973 | - botId 974 | - reason 975 | properties: 976 | botId: 977 | description: "Detached LINE Official Account bot user ID" 978 | type: string 979 | reason: 980 | description: "Reason for detaching" 981 | type: string 982 | enum: 983 | - bot_deleted 984 | 985 | # https://developers.line.biz/en/reference/partner-docs/#activated-event 986 | ActivatedEvent: 987 | description: "This event indicates that the module channel has been switched to Active Channel by calling the Acquire Control API. Sent to the webhook URL server of the module channel." 988 | allOf: 989 | - $ref: "#/components/schemas/Event" 990 | - type: object 991 | required: 992 | - chatControl 993 | properties: 994 | chatControl: 995 | $ref: "#/components/schemas/ChatControl" 996 | ChatControl: 997 | required: 998 | - expireAt 999 | type: object 1000 | properties: 1001 | expireAt: 1002 | type: integer 1003 | format: int64 1004 | 1005 | # https://developers.line.biz/en/reference/partner-docs/#deactivated-event 1006 | DeactivatedEvent: 1007 | description: "This event indicates that the module channel has been switched to Standby Channel by calling Acquire Control API or Release Control API. Sent to the webhook URL server of the module channel." 1008 | allOf: 1009 | - $ref: "#/components/schemas/Event" 1010 | - type: object 1011 | 1012 | # https://developers.line.biz/en/reference/partner-docs/#botsuspend-event 1013 | BotSuspendedEvent: 1014 | description: "This event indicates that the LINE Official Account has been suspended (Suspend). Sent to the webhook URL server of the module channel." 1015 | allOf: 1016 | - $ref: "#/components/schemas/Event" 1017 | - type: object 1018 | 1019 | # https://developers.line.biz/en/reference/partner-docs/#botresumed-event 1020 | BotResumedEvent: 1021 | description: "This event indicates that the LINE Official Account has returned from the suspended state. Sent to the webhook URL server of the module channel." 1022 | allOf: 1023 | - $ref: "#/components/schemas/Event" 1024 | - type: object 1025 | 1026 | # https://developers.line.biz/en/docs/partner-docs/line-notification-messages/message-sending-complete-webhook-event/#overview-delivery-webhook-event 1027 | PnpDeliveryCompletionEvent: 1028 | description: "When a request is made to the LINE notification messages API and delivery of the LINE notification message to the user is completed, a dedicated webhook event (delivery completion event) is sent from the LINE Platform to the webhook URL of the bot server." 1029 | allOf: 1030 | - $ref: "#/components/schemas/Event" 1031 | - type: object 1032 | required: 1033 | - delivery 1034 | properties: 1035 | delivery: 1036 | $ref: "#/components/schemas/PnpDelivery" 1037 | 1038 | PnpDelivery: 1039 | description: "A delivery object containing a hashed phone number string or a string specified by `X-Line-Delivery-Tag` header" 1040 | type: object 1041 | required: 1042 | - data 1043 | properties: 1044 | data: 1045 | type: string 1046 | description: "A hashed phone number string or a string specified by `X-Line-Delivery-Tag` header" 1047 | --------------------------------------------------------------------------------