News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
can't get Access Token
Tags: getting started
Oct 4, 2016 at 8:55am   •   6 replies  •  0 likes
yanmei

I am using VB Code, Here is code:

request = DirectCast(WebRequest.Create("https://platform.devtest.ringcentral.com/restapi/oauth/token HTTP/1.1"), HttpWebRequest)

Dim Credidentials As String = "NF3Unhp_R4yBV2QoMNM0yw" & ":" & "3ONXJwFDS2akvz2CaPZX9AaGAzR8uPTUS1h4z80lGtcA"

Credidentials = Convert.ToBase64String(Encoding.Default.GetBytes(Credidentials))


' Add authentication to request

Dim Userdata As String = "grant_type=password&username=12143477228&extension=101&password=POR2008$"

request.ContentType = "application/x-www-form-urlencoded;charset=UTF-8"

request.Method = "POST"

request.Host = "platform.devtest.ringcentral.com"

request.Headers("Authorization") = "Basic " & Credidentials & "&" & Userdata

request.Accept = "application/json"

ServicePointManager.ServerCertificateValidationCallback = AddressOf AcceptAllCertifications


return error : the remote server returned an error: (404) Not Found


I just want to get access token, then I can continue to do next api call.

6 Answers
answered on Jun 28, 2019 at 11:44pm  

Yes, need to take care the url part https://platform.devtest.ringcentral.com/restapi/oauth/token as documents are sometimes misleading.. like the case here where you were appending HTTP/1.1 in url which is wrong.

Things need to be noticed by developers while copying examples from documents


 0
answered on Oct 6, 2016 at 12:36pm  
Could you provide the final HTTP POST request you used (minus your API keys) so we can compare and update our documentation (in case this fouls up any other developers)?

Thanks,
Benjamin

 0
answered on Oct 6, 2016 at 12:33pm  
I got it work, I remove HTTP 1.1 in URL, In RingCentral Document, there is http 1.1 required, that's wrong. anyway, Thanks for help.

 1
answered on Oct 6, 2016 at 11:22am  
I did test in API console, and got Access_token, I used same Credidentials in HttpWebRequest, just did not work. (401) Unauthorized. it's weird.

 0
answered on Oct 5, 2016 at 7:07am  

thanks. I move UserData to body, get different error:  (401) Unauthorized.

I am using sandbox environment. and sand box account



 0
answered on Oct 4, 2016 at 11:55pm  
This has been made private because app and user credentials have been included in the post. Please do not post your app secret or user passwords openly.

I'm not sure why you are receiving a 404 (is it confirmed to be sending to https?).

User data is supposed to be in the body, not in the Authorization header.


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us