I've added additional credentials to an active app, but still hitting an error that I don't have the credentials. Is there anything I need to do?
If this needs to be tested in sandbox first, my sandbox credentials in the portal are all set to N/A - if this is the case, what are the next steps to do to fix this?
Please clarify what do you mean "add additional credentials to an active app"?
I mean I have an app that is in production. I need to add additional permissions on the app, for example, accessing call recordings, reading, messages etc.permissions on the app, for example, accessing call recordings, reading, messages etc. I've added them in the app settings where you set the app permissions, but it doesn’t seem to work.
Using code flow. I've added them about 3 hours ago. It's not working.
I'm no getting the message property in the records object that is returned from the /call-log endpoint as described here:
https://developers.ringcentral.com/api-reference/Call-Log/readUserCallLog
I'm assuming it's because the permissions aren't updated?
So app permissions are not app credentials!
Your app must be a private app and that is why you can add/remove app permissions to the app even after the app is graduated to the production. This is a new feature and I think it should work.
How long time did you call new APIs from your app after the app was updated with new permission?
What is the auth mode of your app? JWT or password flow or code flow? In any auth mode, you need to get a new access token that would work with new app permissions.
Using code flow. I've added them about 3 hours ago. It's not working.
I'm no getting the message property in the records object that is returned from the /call-log endpoint as described here:
https://developers.ringcentral.com/api-reference/Call-Log/readUserCallLog
I'm assuming it's because the permissions aren't updated?
Added the read messages and read call recordings as shown here:
What is the app client id?
60PkEonZSPm9PKvnCGQIOQ
Your app auth method is not code flow. It is password flow auth.
I see the app got suspended and reactive today around 11AM?
Show me the code how you login (remove sensitive info) and what API do you call and if possible, what error do you receive.
This is the code. I am expecting to see the message property so I can take the recording id and the pull it. As mentioned, the message property is non existent.
async function getAuthToken() { const tokenResponse = await axios.post(`${RINGCENTRAL_SERVER}/restapi/oauth/token`, `grant_type=password&username=${username}&password=${password}&extensionNumber=101`, { auth: { username: clientId, password: clientSecret }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } } ); return tokenResponse.data.access_token; } async function getCallLogWithPagination(dateFrom, dateTo, accessToken) { let callLog = []; let nextPageUri = `${RINGCENTRAL_SERVER}/restapi/v1.0/account/~/call-log?dateFrom=${dateFrom}&dateTo=${dateTo}`; while (nextPageUri) { const callLogResponse = await axios.get(nextPageUri, { headers: { 'Authorization': `Bearer ${accessToken}` } }); callLog = callLog.concat(callLogResponse.data.records); nextPageUri = callLogResponse.data.navigation.nextPage ? callLogResponse.data.navigation.nextPage.uri : null; } return callLog; } async function main() { const accessToken = await getAuthToken(); const dateRange = getDateRange(); let callLog = await getCallLogWithPagination(dateRange.dateFrom, dateRange.dateTo, accessToken); console.log(callLog); } main();
I don't think that your code ever worked before you add new permissions.
I don't know what you meant "the message property is non existent."
And I don't think that your auth function getAuthToken() work at all because I don't see you set the Authorization header.
Read this dev guide and try one of the example with your app and user credentials before using your own code.
This code works, including the auth. Before I've added the other to permissions, I've had only "read call log" and everything worked.
I'm getting back this structure:
{ uri: 'https://platform.ringcentral.com/restapi/v1.0/account/**', id: 'UsiO4aIbz3POzUA', sessionId: '1000790262012', startTime: '2023-01-06T13:01:57.040Z', duration: 39, durationMs: 39338, type: 'Voice', internalType: 'LocalNumber', direction: 'Inbound', action: 'Phone Call', result: 'Voicemail', to: { phoneNumber: '+**' }, from: { name: 'John Smith', phoneNumber: '+1**', location: 'El Cajon, CA' }, telephonySessionId: 's-a0d7b2a21cb58z185872c7998z40a90400000' },
According to this:
https://developers.ringcentral.com/api-reference/Call-Log/readUserCallLog
There is supposed to be a "message" property in this returned object, which is non existent.
Again, my code is authenticating properly and able to pull call log records.
For your reference - from the documentation I mentioned.
I don't know what could be wrong. I have never faced or heard such a problem and I helped many developers to add more app permissions to their app and the app would work as expected.
Let's fast forward this problem. Can you create a new app with all the new app permissions in the sandbox and give me the new app client id so I can help to graduate it to the production so you can try the new app.
New App client ID (Sandbox):
fxBFOFFZTB-ZedzMY8Q8GA
Thanks.
Done! Remember to grab the new app client id and client secret.
Thanks - however I'm still seeing the same behavior. Perhaps the endpoint response schema has changed? How would I get the referenced message property?
You are right. It seems the message object is missing from the response body first level. I will check with the team to see if it is a change or what.
Meanwhile, set the view=Detailed to get the message object under one of the leg objects.
?dateFrom=${dateFrom}&dateTo=${dateTo}&view=Detailed`;
Just to confirm with you that there is no change in the schema. The first level of the response body is the master leg. And if the voicemail/fax belong to the first leg (master leg), the "message" object would be present in the first level of the response. Otherwise, the message object will be present in a leg under the "legs" array.
So the conclusion is that you should always set the view=Detailed if you expect to see the message object.
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