I tried to get a list of all conferences via Twilio PHP helper library, but get 404 error. My code:
$client = new Client($accountSid, $authToken);
foreach ($client->conferences->read() as $conference) {
var_dump($conference);
}
Error:
[HTTP 404] Unable to fetch page: The requested resource /2010-04-01/Accounts/twilio.account_sid/Conferences.json was not found
Thanks for the help in advance!
The problem was in bad credentials I setted. I used test credentials that are only for REST API testing purposes. When I setted correct credentials from https://www.twilio.com/console the problem was solved. Thanks Shachaf.Gortler for the some help.
Related
I'm getting started on Alexa Skill MAnagement SMAPI, so I need to get a refresh token. In the documentation it is specified that 'ask util generate-lwa-tokens' should be used, but in the current version 2.0 of 'ask' this option is no longer available. Thus, I obtained access tokens using postman as described here:
https://gist.github.com/marcelobern/fe44cee1dd5ed624e03b690a447e47fd
But when running some example of smapi what I get is a server error. The example and the error:
from ask_smapi_sdk import StandardSmapiClientBuilder
smapi_client_builder = StandardSmapiClientBuilder(client_id='***',
client_secret='***',
refresh_token='***')
smapi_client = smapi_client_builder.client()
try:
result = smapi_client.list_skills_for_vendor_v1(vendor_id='***', full_response=True)
print("==========================================")
print(result.headers)
print(result.body)
print("==========================================")
except Exception as e:
print(e.body if hasattr(e, 'body') else e)
The error:
{'error_description': 'The server encountered an internal error trying to '
'fulfill the request',
'error_type': 'ServerError'}`
Thank you,
Fernando
This command is now added in the ask-cli v2.1.0, you can check the changelog at
https://github.com/alexa/ask-cli/blob/develop/CHANGELOG.md#210-2020-04-16
Solved. You have to be sure to use a refresh token since access token will throw a server exception
I am working on configuring Twilio messaging using the Twilio api with Subaccounts and MessagingServices.
I am able to create a MessagingService and an IncomingPhoneNumber using the Twilio api. However, if I attempt to set the SmsApplicationSid for the IncomingPhoneNumber to the sid of the MessagingService, I receive the following error:
{
"code": 400,
"message": "Application not found for sid: <--REDACTED-->",
"more_info": "https://www.twilio.com/docs/errors/400",
"status": 400
}
The more_info url (https://www.twilio.com/docs/errors/400) gives me a 404 not found which is not helpful.
I have tried setting the SmsApplicationSid both when first creating the IncomingPhoneNumber resource, as well as in an update after first creating the IncomingPhoneNumber without the SmsApplicationSid value. Both approaches respond with the same error.
The documentation isn't clear on this, but I decided to try adding the IncomingPhoneNumber to the MessagingService and that worked.
Url:
https://messaging.twilio.com/v1/Services/{smsApplicationSid}//PhoneNumbers
Method:
Post
Header:
"PhoneNumberSid", {incomingPhoneNumberSid}
Im trying to get a list of phone numbers under my Twilio account. Im using their example below, I took out the sid and token for security reasons.
include('/lib/Vendor/autoload.php');
use Twilio\Rest\Client;
$sid = "";
$token = "";
$client = new Client($sid,$token);
foreach ($client->incomingPhoneNumbers->read() as $number) {
echo $number->phoneNumber;
}
However I get this error:
Fatal error: Uncaught exception
'Twilio\Exceptions\DeserializeException' with message 'Page Records
can not be deserialized' in
E:\websites\twiliosite\lib\Vendor\twilio\sdk\Twilio\Page.php:90
Any idea what Im doing wrong? I googled this and couldnt find anything.
Twilio developer evangelist here.
Looks like that is thrown here: https://github.com/twilio/twilio-php/blob/master/Twilio/Page.php#L90
I've only taken a glance at the code, but it looks to me like if a response body doesn't contain the page of data that was expected and isn't empty then it throws that error.
This could perhaps happen if the connection was interrupted and the page of data was delivered incomplete. That might explain why it worked for you on the second attempt.
I am trying to use the google_plus_v1_api + google_oauth2_client within a chrome packaged app.
Everythin works fine when i am using only the oauth2 lib:
chrome.identity.getAuthToken(new chrome.TokenDetails(interactive:true))
.then((token){
OAuth2 auth = new SimpleOAuth2(token);
var request = new HttpRequest();
request.onLoad.listen((d){print(request.response);
request.open('GET', 'https://www.googleapis.com/plus/v1/people/me');
auth.authenticate(request).then((request) => request.send());
});
But i can't make google+ lib works:
chrome.identity.getAuthToken(new chrome.TokenDetails(interactive:true))
.then((token){
OAuth2 auth = new SimpleOAuth2(token);
Plus plus = new Plus(auth);
plus.people.get('me').then((d)=>print(d));
});
Return this exception:
GET https://www.googleapis.com/plus/v1/people/me 403 (Forbidden)
Exception: APIRequestException: 403 Daily Limit for Unauthenticated
Use Exceeded. Continued use requires signup.
Am i missing something? How am i supposed to use google+ api lib?
I just saw your answer, but wanted to point out I had the same problem and solved it by setting the makeAuthRequests property of the Plus client to true:
final plusclient.Plus plus = new plusclient.Plus(auth)
..makeAuthRequests = true;
Seems like a more straightfoward solution, since the auth object already contains the token. I would've expected makeAuthRequests to be automatically set to true when constructing a Plus client with an OAuth2 object, but apparently it's not (probably an oversight).
Sorry, i figured out that this line was missing thanks to this tutorial :
plus.oauth_token = auth.token.data;
My google_plus_v1_api query is now working.
Sorry for the inconvenience.
Based on this information:
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=API+Reference#action=openDocument&res_title=OpenSocial_Profiles_API_sbar&content=pdcontent
And a working url for posting updates:
I created this one to try and find out to whom this access token belongs:
https://connections4.e-office.com/connections/opensocial/oauth/rest/people/#me/#self
But than I get Error 501: No service defined for path people/#me/#self
what should the url be ?
Apperently you don't need to include: #Self
This is it:
connections/opensocial/oauth/rest/people/#me/
See also : http://www-10.lotus.com/ldd/appdevwiki.nsf/xsp/.ibmmodres/domino/OpenAttachment/ldd/appdevwiki.nsf/B49DB47061DA9DEB85257AC9006D5256/attach/AppDev_OpenSocial.pdf
You can use the Profiles REST API URLs:
http(s)://yourserver/profiles/admin/atom/profileEntry.do?email=mailaddress
or
http(s)://yourserver/profiles/admin/atom/profileEntry.do?uid=uid