I have created a sandbox app. I am using RestClient api . With the credentials from my sandbox. Password is my Ringcentral account pasword.
restClient = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER);
restClient.authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD);
I get error on authentication.
AceRoutingKey: sjc11-c01-ace11.1e06d9b3-8c80-11eb-971a-005056bb8878
11:27:09,559 ERROR [stderr] (test task-9) RoutingKey: SJC11P01
11:27:09,559 ERROR [stderr] (test task-9)
11:27:09,559 ERROR [stderr] (test task-9) {
11:27:09,559 ERROR [stderr] (test task-9) "error" : "invalid_grant",
11:27:09,559 ERROR [stderr] (test task-9) "errors" : [ {
11:27:09,559 ERROR [stderr] (test task-9) "errorCode" : "OAU-140",
11:27:09,559 ERROR [stderr] (test task-9) "message" : "Invalid resource owner credentials"
11:27:09,559 ERROR [stderr] (test task-9) } ],
11:27:09,559 ERROR [stderr] (test task-9) "error_description" : "Invalid resource owner credentials"
11:27:09,559 ERROR [stderr] (test task-9) }
Please let me know what is wrong here? I have setup the sanbox as per teh instruction specidfied for password authentication type.
i changed my sandbox password and passing that password but get error when i use RestClient.java
I looked for a sandbox account with this main company number "+13128589132" and found nothing. I doubt that this is the username for your dev portal, not your sandbox
RestClient started working now after with new sandbox password. I am now trying to use ok3Http gives 404 error for below url . Basic authentication set in header for {clientid:secretkey}
You said RestClient started working and you still have problem to authenticated a user. So what really worked? Are you using the Java SDK?
RestClient is now working. Since that was not working i also tried making rest call using okhttp. This below code is till giving me 404 response code.
The response code is 404. So i am not sure
static String RINGCENTRAL_SERVER = "https://platform.devtest.ringcentral.com";
String token="RINGCENTRAL_CLIENTID"+":"+RINGCENTRAL_CLIENTSECRET;
String encodeString = Base64.getEncoder().encodeToString(token.getBytes());
okhttp3.Response response1 = null; try { okhttp3.OkHttpClient client = new okhttp3.OkHttpClient(); String url =RINGCENTRAL_SERVER+"/restapi/oauth/token?grant_type=password&username="+RINGCENTRAL_USERNAME+"&extension="+RINGCENTRAL_EXTENSION+"&password="+RINGCENTRAL_PASSWORD;
okhttp3.Request request1 = new okhttp3.Request.Builder().url(url)
.addHeader("authorization", "Basic " + encodeString).build();
response1 = client.newCall(request1).execute(); int retString = response1.code();
Never mind i got it working with oauth too
You said "Password is my Ringcentral account pasword." Do you mean the user name and password you login the RingCentral dev portal at https://developers.ringcentral.com? If that is the case, it is wrong.
You can find our sandbox username from the dev portal by select the "Sandbox Accounts" option.
the user name is phone no. I copied the credentials from the JSON
{"RINGCENTRAL_CLIENTID":"G2IVTQIvRriGGO4QEiIt9Q","RINGCENTRAL_CLIENTSECRET":"Mx8cfv-kRLSpTP0RIB7wfQ43NGUOqjQfWS5_TAjxXU9A","RINGCENTRAL_SERVER":"https://platform.devtest.ringcentral.com","RINGCENTRAL_USERNAME":"+13128589132","RINGCENTRAL_EXTENSION":"101","RINGCENTRAL_PASSWORD":"<YOUR ACCOUNT PASSWORD>"}
What do you mean by Your account password? in credentials it just shows "Active". So i used my Ringcentral account pasword.
Don't ask me. That was what you wrote
"I have created a sandbox app. I am using RestClient api . With the credentials from my sandbox. Password is my Ringcentral account pasword."
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