{"id":16423146,"url":"https://github.com/hailiang-wang/directlineapi","last_synced_at":"2025-10-26T22:31:37.442Z","repository":{"id":57212246,"uuid":"63512728","full_name":"hailiang-wang/DirectLineApi","owner":"hailiang-wang","description":"Microsoft Botframework Direct Line API library","archived":false,"fork":false,"pushed_at":"2018-07-03T11:47:09.000Z","size":14,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T00:51:05.387Z","etag":null,"topics":["bot","botframework","chatbot","microsoft"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/directline-api","language":"JavaScript","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/hailiang-wang.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}},"created_at":"2016-07-17T03:21:20.000Z","updated_at":"2020-11-19T21:34:54.000Z","dependencies_parsed_at":"2022-09-04T03:50:49.870Z","dependency_job_id":null,"html_url":"https://github.com/hailiang-wang/DirectLineApi","commit_stats":null,"previous_names":["rockq-org/directlineapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hailiang-wang%2FDirectLineApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hailiang-wang%2FDirectLineApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hailiang-wang%2FDirectLineApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hailiang-wang%2FDirectLineApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hailiang-wang","download_url":"https://codeload.github.com/hailiang-wang/DirectLineApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238408452,"owners_count":19467097,"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":["bot","botframework","chatbot","microsoft"],"created_at":"2024-10-11T07:38:56.173Z","updated_at":"2025-10-26T22:31:37.151Z","avatar_url":"https://github.com/hailiang-wang.png","language":"JavaScript","readme":"# Microsoft Botframework Direct Line API library\n[![chatoper banner][co-banner-image]][co-url]\n\n[co-banner-image]: https://user-images.githubusercontent.com/3538629/42217321-3d5e44f6-7ef7-11e8-94e7-1574bfa1dbb8.png\n[co-url]: https://www.chatopera.com\n\n# welcome\nThe Direct Line API is a simple REST API for connecting directly to a single bot. This API is intended for developers writing their own client applications, web chat controls, or mobile apps that will talk to their bot.\n\nhttps://docs.botframework.com/en-us/restapi/directline/\n\n## Install\n```\nnpm install directline-api\n```\n\n## API\n\n\u003e Check out test/test.js for samples.\n\n```\nvar client = require('directline-api');\n// get a token\nclient.getToken(secret);\n\n// create a conversation\nclient.createConversation(token);\n\n// post a message in a conversation\nclient.postMessage(token, conversationId, {\n                text: 'YOUR_TEXT'\n            });\n\n// post a message with an userId, userId is your unique id for message sender.\nclient.ask(token, conversationId, {\n                        text: 'YOUR_TEXT',\n                        from: 'FROM_USERID'\n                    });\n\n// post a file in a conversation\nclient.postFileMessage(token, conversationId, formData);\n\n// get messages in a conversation\nclient.getMessages(token, conversationId, [watermark]);\n\n// generate a new conversation and token\nclient.generateConversationAndToken(secret);\n\n// renew a token for a conversation\nclient.renewConversationToken(token, conversationId);\n\n// request with a text and get response\n// https://docs.botframework.com/en-us/restapi/directline/#!/Conversations/Conversations_PostMessage\nclient.ask(token, conversationId, body);\n\n```\n\n## Run Test\n```\nnpm install\ntouch test/conf.json # ADD secret as 'DIRECT_LINE_SECRET'\nnpm test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhailiang-wang%2Fdirectlineapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhailiang-wang%2Fdirectlineapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhailiang-wang%2Fdirectlineapi/lists"}