php - How to integrate hipchat in a website? -


i trying integrate hip chat website.
hip chat doc

i go through above doc.but able understand how start. saying create add on , many thing. using api able post , data of 1 user. want integrate hip chat chat server in website don't
how start , how implement that. if 1 have example or demo plz me.
below code tried:

// getting room information  // rooms "https://api.hipchat.com/v2/room?auth_token=xxxxxx"  //message 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 

this code working fine .but working 1 user want work of user . , not able generate access token every user automatically. tried access token :

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 more information.",     "type": "unauthorized" 

i think not able post on behalf of users using 1 token. it's security issue. instead may need following

  1. require users login in website
  2. create page them grant access hipchat
  3. bind access token returned hipchat profile in website
  4. use corresponding token post on behalf of users when logged in

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -