plivo-php: Client Error Response while sending SMS
I get the following error while trying to make a POST request to send message:
Client error response [status code] 400 [reason phrase] BAD REQUEST [url] https://api.plivo.com/v1/Account/{AUTH ID}/Message/
When you look at the trace, there’s an exception being thrown by Guzzle. But there’s no way to know what may be wrong with the request being made by Plivo.
Any idea how to solve this?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 22
You should use
composer init
in your project directory to make a newcomposer.json
file for your project which then references theplivo/plivo-php
package. See https://getcomposer.org/doc/01-basic-usage.md and https://getcomposer.org/doc/03-cli.md#init for more detailsHi , While writing sample send sms php script I am facing following error. Please help me to fix this.
Below is my php script
`<?php require ‘vendor\autoload.php’; use Plivo\RestAPI; $auth_id = “VALID_AUTH_ID”; $auth_token = “VALID_AUTH_TOKEN”; $p = new RestAPI($auth_id, $auth_token);
?>`
my composer.json is
{ "name": "plivo/plivo-php", "description": "Plivo PHP helper library to access PlivoCloud API and generate Plivo XML", "authors": [ { "name": "Plivo Team", "email": "hello@plivo.com" }, { "name": "Ben McInturff", "email": "benmcinturff@gmail.com" }, { "name": "Adam Homsi", "email": "adam.homsi@gmail.com" }, { "name": "Radu Topala", "email": "radu.topala@trisoft.ro" } ], "license": "MIT", "require": { "guzzlehttp/guzzle": "~6.0" }, "autoload": { "classmap": ["plivo.php"] } }