I am trying video call using Twilio but I am getting issue when I am trying to get access token, In Twilio we can not make a video call without access token.
Can you guy's suggest me how we can get access token using REST API.
I have tried but not success.
I am getting below error:-
{"code": 20404, "message": "The requested resource /2010-04-01/Accounts/AC39270a782801db8da282e5ed88b0bbc3/authorize/token.json was not found", "more_info": "https://www.twilio.com/docs/errors/20404", "status": 404}
I think this issue is due to end point so please help me to solve this issue.
HTTP Request:-
public void authorizeTwillio(){
String VERSION = '3.2.0';
Http htp = new Http();
HttpRequest request = new HttpRequest();
HttpResponse response = new HttpResponse();
ConversationsGrant grant = new ConversationsGrant();
String path = endpoint + '/2010-04-01/Accounts/' + this.twilioAccountSid + '/authorize/token.json';
URL uri = new URL(path);
request.setEndpoint(uri.toExternalForm());
request.setHeader('X-Twilio-Client', 'salesforce-' + VERSION);
request.setHeader('User-Agent', 'twilio-salesforce/' + VERSION);
request.setHeader('Accept', 'application/json');
request.setHeader('Accept-Charset', 'utf-8');
request.setHeader('Authorization', 'Basic '+EncodingUtil.base64Encode(Blob.valueOf(this.twilioAccountSid + ':' + this.twilioAuthToken)));
request.setMethod('POST');
response = htp.send(request);
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info,response.getBody()));
}
Thanks in advance.