{"id":21517747,"url":"https://github.com/channel-io/app-tutorial","last_synced_at":"2026-07-18T23:35:01.940Z","repository":{"id":241264157,"uuid":"798084036","full_name":"channel-io/app-tutorial","owner":"channel-io","description":"This is a tutorial to develop an app server of Channel Talk well!","archived":false,"fork":false,"pushed_at":"2024-05-23T05:07:59.000Z","size":3263,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-23T07:45:45.765Z","etag":null,"topics":["app","app-server","app-store","channel","channeltalk","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/channel-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-09T04:09:56.000Z","updated_at":"2024-05-23T07:45:57.269Z","dependencies_parsed_at":"2024-05-23T07:45:52.499Z","dependency_job_id":"15a1a746-d013-4b22-b17b-1f5b762ad045","html_url":"https://github.com/channel-io/app-tutorial","commit_stats":null,"previous_names":["channel-io/app-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channel-io%2Fapp-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channel-io%2Fapp-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channel-io%2Fapp-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/channel-io%2Fapp-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/channel-io","download_url":"https://codeload.github.com/channel-io/app-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244068558,"owners_count":20392844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app","app-server","app-store","channel","channeltalk","golang"],"created_at":"2024-11-24T00:44:56.338Z","updated_at":"2025-10-11T12:40:41.731Z","avatar_url":"https://github.com/channel-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# app-tutorial\n\nHello, world!\n\nThis project is a tutorial to develop app-server of Channel Corp. App Store.\n\nThank you for visiting. 😁\n\n| Index                         |                                                       |\n| ----------------------------- | ----------------------------------------------------- |\n| [Prerequisite](#prerequisite) | -                                                     |\n| [Installation](#installation) | -                                                     |\n| [Build](#build)               | # [Build the whole project](#build-the-whole-project) |\n|                               | # [Build only the wam](#build-only-wam)               |\n| [APIs](#apis)                 | # [ping](#ping)                                       |\n|                               | # [functions](#functions)                             |\n|                               | # [wam(static)](#wam)                                 |\n\n## Prerequisite\n\n- [go](https://go.dev/) v1.21\n- [yarn](https://yarnpkg.com/) v4; Check [here](wam) for wam.\n\n## Installation\n\nIt is available to download the necessary packages for the project by running one of the following commands:\n\n1. Use makefile.\n\n```sh\n$ make init\n```\n\n2. Use go cli.\n\n```sh\n$ go mod tidy\n```\n\n## Build\n\n### Build the whole project\n\n```sh\n$ make build # it builds wam, either.\n```\n\n### Build only wam\n\n```sh\n$ make build-wam\n```\n\n## Run\n\n### Configuration\n\nBefore running the program, make sure to check the [configuration](config/development.yml) file.\n\nYou must prepare the metadata of the app by registering one to Channel App Store.\n\n```yaml\nstage: development # name of the env\n\nappId: # app id registered in advance\nappSecret: # app secret issued in advance\n\napi:\n  public:\n    http:\n      port: 3022 # port number of the server\n\nappStore:\n  baseUrl: # api endpoint of the Channel App Store\n\nbot:\n  name: AppTutorialBot # bot name to write messages in groups\n```\n\n### Run the program\n\n```sh\n$ STAGE=\"your stage\" make dev\n```\n\nThe default setting for the stage is `development`.\n\n## APIs\n\n### ping\n\n| METHOD | PATH    |\n| ------ | ------- |\n| GET    | `/ping` |\n\n#### Request\n\n```json\n(empty)\n```\n\n#### Response\n\n```text\npong\n```\n\n### functions\n\n| METHOD | PATH         |\n| ------ | ------------ |\n| PUT    | `/functions` |\n\nThis api is to request general functions defined in the project.\n\nYou must register it as a functionUrl of the app.\n\nNote that `context` in the function request is automatically full by the Channel App Store.\n\n#### Request\n\n_NOTE:The values in the context field of the request body will be automatically populated by the App Store._\n\n1. tutorial (to prepare wam arguments before opening the wam)\n\n```json\n{\n    \"method\": \"tutorial\",\n    \"context\": {\n        \"channel\": {\n            \"id\": \"channel id which calls the wam\"\n        },\n        \"caller\": {\n            \"type\": \"manager\",\n            \"id\": \"manager id which calls the wam\"\n        }\n    }\n}\n```\n\n2. sendAsBot\n\n`sendAsBot` is a function to write message as a bot.\n\nYou can set the name of the bot with [configuration](config) files.\n\n```json\n{\n    \"method\": \"sendAsBot\",\n    \"params\": {\n        \"input\": {\n            \"groupId\": \"group id to write a message\",\n            \"rootMessageId\": \"thread id\",\n            \"broadcast\": false\n        }\n    },\n    \"context\": {\n        \"channel\": {\n            \"id\": \"channel id which calls the wam\"\n        },\n        \"caller\": {\n            \"type\": \"manager\",\n            \"id\": \"manager id which calls the wam\"\n        }\n    }\n}\n```\n\n#### Response\n\n_**Success**_\n\n```\n200 OK\n```\n\n1. tutorial\n\n```json\n{\n    \"result\": {\n        \"type\": \"wam\",\n        \"attributes\": {\n            \"appId\": \"app id\",\n            \"name\": \"tutorial\",\n            \"wamArgs\": {\n                \"managerId\": \"4761\",\n                \"message\": \"This is a test message sent by a manager.\"\n            }\n        }\n    }\n}\n```\n\n2. sendAsBot\n\n```json\n{\n  \"result\": {\n        \"type\": \"string\",\n        \"attributes\": {}\n  }\n}\n```\n\n_**Failure**_\n\n```\n200 OK\n```\n\n```json\n{\n    \"error\": {\n        \"type\": \"\",\n        \"message\": \"the reason of the failure\"\n    }\n}\n```\n\nNote that both the success and the failure return `200 OK` for each request.\n\n### wam\n\n| METHOD | PATH                     |\n| ------ | ------------------------ |\n| -      | `/resource/wam/tutorial` |\n\nThis endpoint serves a static page of the wam.\n\nYou must register it(`/resource/wam`) as a wamUrl of the app.\n\n#### Response\n\n```\nThe wam written in HTML.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchannel-io%2Fapp-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchannel-io%2Fapp-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchannel-io%2Fapp-tutorial/lists"}