Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error unknow #31

Open
jorgertrias opened this issue Jan 21, 2020 · 0 comments
Open

Error unknow #31

jorgertrias opened this issue Jan 21, 2020 · 0 comments

Comments

@jorgertrias
Copy link

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error response [url] https://api.ovh.com/1.0/sms/ [status code] 403 [reason phrase] Forbidden' in /var/www/vhosts/formainap.net/subdomains/idiomas/application/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:89 Stack trace: #0 /var/www/vhosts/formainap.net/subdomains/idiomas/application/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php(33): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Message\Request), Object(GuzzleHttp\Message\Response)) #1 /var/www/vhosts/formainap.net/subdomains/idiomas/application/vendor/guzzlehttp/guzzle/src/Event/Emitter.php(108): GuzzleHttp\Subscriber\HttpError->onComplete(Object(GuzzleHttp\Event\CompleteEvent), 'complete') #2 /var/www/vhosts/formainap.net/subdomains/idiomas/application/vendor/guzzlehttp/guzzle/src/RequestFsm.php(91): GuzzleHttp\Event\Emitter->emit('complete', Object(GuzzleHttp\Event\CompleteEvent)) #3 /var/www/vhosts/formainap.net/subdomains/idiomas/applica in /var/www/vhosts/formainap.net/subdomains/idiomas/application/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 89

The code:

`require $_SERVER['DOCUMENT_ROOT'].'/application/vendor/autoload.php';
use \Ovh\Api;

$endpoint = 'ovh-eu';
$applicationKey = "xxxxx";
$applicationSecret = "xxxxxx";
$consumer_key = "xxxxxxxx";

$conn = new Api( $applicationKey,
$applicationSecret,
$endpoint,
$consumer_key);

$smsServices = $conn->get('/sms/');
foreach ($smsServices as $smsService) {

print_r($smsService);

}

$content = (object) array(
"charset"=> "UTF-8",
"class"=> "phoneDisplay",
"coding"=> "7bit",
"message"=> "Ya están disponibles los SMS de OVHcloud en api.ovh.com",
"noStopClause"=> false,
"priority"=> "high",
"receivers"=> [ "+3460000000" ],
"senderForResponse"=> true,
"validityPeriod"=> 2880
);
$resultPostJob = $conn->post('/sms/'. $smsServices[0] . '/jobs/', $content);

print_r($resultPostJob);

$smsJobs = $conn->get('/sms/'. $smsServices[0] . '/jobs/');
print_r($smsJobs);
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant