我正在尝试将 hip chat 整合到我的网站中。
嘻哈聊天文档
我浏览了上面的文档。但我能够理解如何开始。他们说要创建附加组件和许多东西。使用 api 我可以发布和获取数据,但只有一个用户。我想在我的网站中像聊天服务器一样集成 Hip 聊天,但我不知道
如何开始以及如何实现它。如果有人有示例或演示请帮助我。
下面是我尝试过的代码:
// getting all room information
// Rooms
"https://api.hipchat.com/v2/room?auth_token=XXXXXX"
//message to room
https://api.hipchat.com/v2/room/2068981/notification?auth_token=XXXXXX
//Message history
https://api.hipchat.com/v2/room/2068981/history?auth_token=XXXXXX&max-results=1000&reverse=true
这段代码工作正常。但它只适用于一个用户,我希望它适用于所有用户。而且我也无法自动为每个用户生成访问令牌。我尝试了访问令牌:
curl -d '{"username":"abc@rediff.com","grant_type":"password","password":"XXXX"}' -H 'Content-Type: application/json' https://domain.hipchat.com/v2/oauth/token
{
"error": {
"code": 401,
"message": "Authenticated requests only. See https://www.hipchat.com/docs/apiv2/auth for more information.",
"type": "Unauthorized"