1
我正在尝试整合髋关节我在我的网站上聊天。
Hip chat doc如何将hipchat整合到网站中?
我通过上面的doc.But我能够明白如何开始。 他们说要创造附加和许多事情。 使用API我能够发布和获取数据,但只有一个用户。 我想在我的网站中整合像聊天服务器这样的Hip聊天,但我不会
如何开始以及如何实现该功能。 如果有人有示例或演示PLZ帮助我。
下面是我试过的代码:
// 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":"[email protected]","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"
登录有没有办法通过使用用户的用户名和密码令牌自动获得访问权限。 –
恐怕没有...授予过程假定您不知道用户的HipChat密码。您需要让用户登录到HipChat,然后授予您网站的令牌...一个接一个。 – slbteam08
现在我用你的方式感谢你 –