Hello. We are using JWT authorization for the application.
We use official js SDK https://github.com/ringcentral/ringcentral-js
Here is what my authorization looks like:
const rcSdk = new SDK({
server: SDK.servereenvironment],
clientId,
clientSecret
});
this.platform = rcSdk.platform();
await this.platform.login({ jwt: this.jwt });
After that, we are working with different API, for example
public async ringOut(from: string, to: string): Promise<RingOutResponse> {
const response = await this.platform.post('/restapi/v1.0/account/~/extension/~/ring-out', {
from: { phoneNumber: from },
to: { phoneNumber: to },
playPrompt: false,
});
return response.json() as Promise<RingOutResponse>;
}
public async searchAccountsByEmail(email: string): Promise<DirectorySearchResponse> {
const response = await this.platform.post(`/restapi/v1.0/account/~/directory/entries/search`, {
searchString: email,
});
return response.json() as Promise<DirectorySearchResponse>;
}
public async getCallLogs(telephonySessionId: string): Promise<GetCallLogsResponse> {
const response = await this.platform.get(`/restapi/v1.0/account/~/call-log`, {
telephonySessionId,
});
return response.json() as Promise<GetCallLogsResponse>;
}
But after some time (it could be an hour, it could be 20+ hours, I don't know the pattern for sure) we receive an error while calling an API Refresh token is missing
It happens too often and it really disrupts our work.
Could you please help us?
Thanks.