twilio / twilio-php

A PHP library for communicating with the Twilio REST API and generating TwiML.
MIT License
1.55k stars 559 forks source link

How can i validate ACCOUNT SID & AUTH TOKEN ?? #677

Closed Ok9xNirab closed 3 years ago

Ok9xNirab commented 3 years ago

I didn't see any methods to validate credentials !!

shwetha-manvinkurke commented 3 years ago

Hi @Ok9xNirab The credentials are validated automatically when you create a client instance. What exactly is your use case?

Ok9xNirab commented 3 years ago

Hi @Ok9xNirab The credentials are validated automatically when you create a client instance. What exactly is your use case?

I'm making a wordpress plugin . So, I want to validate Twilio credentials before saved !!

I already do it by Guzzle-http . Here is my code : https://github.com/springdevs/SMS/blob/c309731b8b09479fb1cb71638a856b1f70075cf2/includes/Admin/Forms.php#L27

Thanks.

shwetha-manvinkurke commented 3 years ago

Maybe try the verify api?

Ok9xNirab commented 3 years ago

Maybe try the verify api?

Yes . validate account sid & token , before saved !!