Closed torsk closed 7 years ago
Not with sipgate.io but you can do it with our REST-API (take a look at the history
call).
The API uses OAuth 2 for authorization and we have small chapter in our sipgate.io cookbook to help people get started with it.
This is an interactive approach, isn't it? That's a pity, I need a fully automated process. Or did I miss something? I consider applying a mechanize here is exaggerated.
Hi torsk,
requesting the access token for your account through your script/app is an interactive process for the first time. afterwards your app/script can us the token fully automated.
If it's just a script you run locally and with your account you can also use https://api.sipgate.com/doc/#!/authorization/create and use the json/webtoken to authenticate yourself.
I hope this helps
Thanks a lot you for your help. I was able to receive a token from https://api.sipgate.com/v1/authorization/token. But I still am stopped by a "403 Forbidden. The request is
curl -v -X GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer <token>' --data '{ "phonelineId": "p0", "types": "CALL", "offset": "0", "limit": "10" }' 'https://api.sipgate.com/v1/<my_phone_number>/history'
I took my phone number as userId. Is this correct?
I'm afraid, that there's a stupid mistake or misunderstanding on my side. I apologize for that.
Ah. I finally made it. The appropriate values (like userid and url path) for the above request are received from
https://api.sipgate.com/v1/numbers
Hi again,
https://api.sipgate.com/v1/<my_phone_number>/history
should be https://api.sipgate.com/v1/<your_user>/history
whereas your user probably is "w0"
https://api.sipgate.com/doc/#!/history/getHistory describes all the params and also has example values given.
Thanks again for your help and your patience.
I did read the documentation, but (at least for a aipgate beginner it is not that easy to understand. Where do you get the id from? it is not shown in the Sipgate web frontend. But: Everything is fine now and the script is working (the part of the server request anyhow). I'll close this topic.
Thanks a lot for your help
Regarding the ID. you can decode the id from the json webtoken. otherwise you could call /users and find your user in the response and get the id from there.
Is it possible to get a list of missed calls via sipgate.io?
Kann ich eine Liste der entgangenen (oder natürlich auch aller anderen) Anrufe requesten? Habe keine Möglichkeit dafür gefunden.