Gitkit_ServerException: Error code: 17 - php

I'm attempting to implement the password reset flow for Google Identity Toolkit with the php sdk. I am able to use the sdk to do everything needed except setting up the mail endpoint which exits with the following error.
Here is the code that generates the exception:
try {
$oobResult = $gitkitClient->getOobResults();
echo $oobResult['response_body'];
}
catch (Exception $e) {
print "Exception $e";
}
And the exception:
Exception exception 'Gitkit_ServerException' with message 'Error code: 17' in C:\...\vendor\google\identity-toolkit-php-client\src\RpcHelper.php:229
Stack trace:
#0 C:\...\vendor\google\identity-toolkit-php-client\src\RpcHelper.php(208): Gitkit_RpcHelper->checkGitkitError(Array)
#1 C:\...\vendor\google\identity-toolkit-php-client\src\RpcHelper.php(179): Gitkit_RpcHelper->invokeGitkitApiWithServiceAccount('getOobConfirmat...', Array)
#2 C:\...\vendor\google\identity-toolkit-php-client\src\GitkitClient.php(371): Gitkit_RpcHelper->getOobCode(Array)
#3 C:\...\vendor\google\identity-toolkit-php-client\src\GitkitClient.php(299): Gitkit_Client->buildOobLink(Array, 'resetPassword')
#4 C:\...\auth\mail.php(14): Gitkit_Client->getOobResults(Array, '192.168.1.1')
Does anyone know what this error indicates and how to resolve it?
This function from the readme.md generates the same 'Error code: 17'
$gitkitClient->getEmailVerificationLink("emailgoeshere");
These functions from the readme.md do work as expected:
$gitkitClient->getUserById("useridgoeshere");
$gitkitClient->deleteUser("useridgoeshere");
$gitkitClient->getAllUsers(3);

This is caused by a known issue on Identity Toolkit and is now fixed. Can you go the Google Developer Console and make sure you have the correct send email endpoint in your Identity Toolkit config? Also make sure you put the same send email endpoint in your widget config. It should work now.

Related

No Content Exception Error in Zoho Api v2 in php sdk

Hi I hope everybody is doing well
I am trying to add leads to Zoho CRM using API v2, now for that, if the user already there I will update its record if a user is not there I will create a new record into it, right now I am finding out a way to handle the exception error when there is not any user in CRM it displays this line
Fatal error: Uncaught zcrmsdk\crm\exception\ZCRMException Caused by:'No Content' in C:\xampp\htdocs\crmint2\vendor\zohocrm\php-sdk\src\crm\api\response\BulkAPIResponse.php(61) #0 C:\xampp\htdocs\crmint2\vendor\zohocrm\php-sdk\src\crm\api\response\CommonAPIResponse.php(76): zcrmsdk\crm\api\response\BulkAPIResponse->handleForFaultyResponses() #1 C:\xampp\htdocs\crmint2\vendor\zohocrm\php-sdk\src\crm\api\response\CommonAPIResponse.php(67): zcrmsdk\crm\api\response\CommonAPIResponse->processResponse() #2 C:\xampp\htdocs\crmint2\vendor\zohocrm\php-sdk\src\crm\api\response\BulkAPIResponse.php(47): zcrmsdk\crm\api\response\CommonAPIResponse->__construct('HTTP/1.1 204 \r\n...', 204) #3 C:\xampp\htdocs\crmint2\vendor\zohocrm\php-sdk\src\crm\api\APIRequest.php(148): zcrmsdk\crm\api\response\BulkAPIResponse->__construct('HTTP/1.1 204 \r\n...', 204) #4 C:\xampp\htdocs\crmint2\vendor\zohocrm\php-sdk\src\crm\api\handler\MassEntityAPIHandler.php(327): zcrmsdk\crm\api\APIRequest->getBulkAPIResponse() #5 C:\xampp\htdocs\crmint2\vendor\zoh in C:\xampp\htdocs\crmint2\vendor\zohocrm\php-sdk\src\crm\api\response\BulkAPIResponse.php on line 61
Now I have tried try and catch statement as well but it stucks here and crashes the application, I am looking forward to someone who had gone through this and was successful in implementing it

soundcloud api php add follower

I am making a page where you can log in with your soundcloud and gain access to download my songs as long as you are following me on soundcloud. I have authentication working but cannot figure out the following part. I pretty much copied and pasted the examples from the soundcloud developers website under the like and follow section, and it seams neither is working how its supposed to. The try catch makes it appear that i am not following my main account (which i got the user id# from testing the authentication step) even if i go on soundcloud, on my test account and follow my main account. Here is the error I am getting:
Warning: Missing argument 2 for Services_Soundcloud::put(), called in /my_website/index.php on line 43 and defined in /my_website/Services/Soundcloud.php on line 636
Notice: Undefined variable: postData in /my_website/Services/Soundcloud.php on line 642
Fatal error: Uncaught exception 'Services_Soundcloud_Invalid_Http_Response_Code_Exception' with message 'The requested URL responded with HTTP code 404.' in /my_website/Services/Soundcloud.php:941
Stack trace:
#0 /my_website/Services/Soundcloud.php(645): Services_Soundcloud->_request('https://api.sou...', Array)
#1 /my_website/index.php(43): Services_Soundcloud->put('/me/followings/...')
#2 {main}
thrown in my_website/Services/Soundcloud.php on line 941
heres the code im running:
require_once 'Services/Soundcloud.php';
//session_destroy();
session_start();
$soundcloud = new Services_Soundcloud(client_id, secret_id, redirect_uri)
$authURL = $soundcloud->getAuthorizeUrl();
echo "<pre>";
if (!empty ($_SESSION['token'])){
$soundcloud->setAccessToken($_SESSION['token']);
} else if(!empty($_GET['code'])){
try{
$accessToken = $soundcloud->accessToken($_GET['code']);
$_SESSION['token'] = $accessToken['access_token'];
$soundcloud->setAccessToken($_SESSION['token']);
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
} else {
echo "<a href='".$authURL."'><img border='0' alt='Connect with Soundcloud' src='connect.png'></a>";
}
if (!empty ($_SESSION['token'])){
// check the status of the relationship
echo $_SESSION['token'];
try {
$soundcloud->get('/me/followings/#######');
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
if ($e->getHttpCode() == '404')
print "You are not following user #######\nTrying to follow now\n";
$soundcloud->put('/me/followings/#######');
}
}
Are the examples on soundcloud wrong or am i doing something wrong before i get to those commands?
also please note that my soundcloud object init and followings/##### was changed to protect my information.
after a lot of research and trial and error if figured out that setting the path to:
https://api.soundcloud.com/me/followings/#######?oauth_token=MY_TOKEN
seems to work. I don't know if this is just a workaround or how the API was intended to be used but its the only way i could get it to work, i was assuming the soundcloud client object was sending the token automatically with the command but it appears not.
I have also figured out that if it does find a match (user is following the id number) then it returns a 303 error, which the api guide does not even list in their http error codes.
You have a slash in front of me which must not be there. The following works for me:
$soundcloud->put('me/followings/#########','',array(CURLOPT_HTTPHEADER => array('Content-Type: application/xml')));

Unable to run OpenTok's WebRTC demo

Recently I tried to use OpenTok's WebRTC demo for a web application requiring peer-to-peer video/audio communication.
I went through the tutorials on http://www.tokbox.com/opentok/webrtc/docs/js/tutorials/ and http://www.tokbox.com/opentok/docs/server/server_side_libraries.html and I got something working using JavaScript (client-side) and PHP's library (server-side) for token/session generation.
I managed to code a basic peer-to-peer chat room locally. However, as soon as I upload it to a web server it blows up returning the following error:
Fatal error: Uncaught exception 'RequestException' with message 'Request error: Failed
to connect to 70.42.47.98: Permission denied' in /home/www/dummy_url.com/php-
sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php:192 Stack trace: #0 /home/www/dummy_url.com/php-
sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php(107): OpenTokSDK->_do_request('/session/create',
Array) #1 /home/www/dummy_url.com/php-sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php(221):
OpenTokSDK->createSession('74.96.245.119', Array) #2 /home/www/dummy_url.com/php-
sdk/index.php(16): OpenTokSDK->create_session('74.96.245.119', Array) #3 {main} thrown
in /home/www/dummy_url.com/php-sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php on line 192
I took a look at line 192:
//die(function_exists('curl_version')); // debugging
$res = curl_exec($ch);
if(curl_errno($ch)) {
throw new RequestException('Request error: ' . curl_error($ch)); // <=== LINE 192
}
curl_close($ch);
and verified the server had curl enabled. It does.
Then I tried to run the demo test and it fails at:
Assertion Failed: File '/home/www/skillfullearning.net/test/test/TestOpenTokSDK.php'
Line '102'
Code ''
What's in Line '102'? This:
...
$token = $a->generateToken("mysession", RoleConstants::MODERATOR, gmmktime() + 100000);
assert('$token');
$token = $a->generateToken("mysession", RoleConstants::MODERATOR, gmmktime());
assert('$token');
try {
$token = $a->generateToken("mysession", RoleConstants::MODERATOR, gmmktime() +
1000000);
assert(false);
} catch (Exception $e) {
assert('$e'); // <================ LINE 102
}
...
I really don't know where to go from here. I would really appreciate some help with this matter.
/E
The error is caused by outdated tests. Here is an outstanding issue, hopefully it will be resolved soon. if you simply remove the test files, you would not have that problem anymore.

How to test google market place api with php

I'm trying to use this api http://code.google.com/p/android-market-api/. I would like to get some that from play store. like App name, description, screenshots and download rating(total downloads, week downloads....)
I'm using the php version. I uploaded all the code to my personal server. www.example.com/test/.
Should I configure anything else in addition of local.php, email and password fields? I only did that.
I have this error:
Uncaught exception 'Exception' with message 'HTTP request returned code 400' in /homepages/31/d229886149/htdocs/carlos/test/Market/MarketSession.php:212 Stack trace:
#0 /homepages/31/d229886149/htdocs/carlos/test/Market/MarketSession.php(160): MarketSession->executeRawHttpQuery('??????DQAAAMkAA...')
#1 /homepages/31/d229886149/htdocs/carlos/test/Market/MarketSession.php(147): MarketSession->executeProtobuf(Object(Request))
#2 /homepages/31/d229886149/htdocs/carlos/test/examples/test_categories.php(15): MarketSession->execute(Object(Request_RequestGroup))
#3 {main} thrown in /homepages/31/d229886149/htdocs/carlos/test/Market/MarketSession.php
on line 212
Thank you.
After that I would like to implement it with codeIgniter
try with '0123456789123456' as an ANDROID_DEVICEID
define('GOOGLE_EMAIL','someone#gmail.com');
define('GOOGLE_PASSWD','SomePassword');
define('ANDROID_DEVICEID','0123456789123456');

Amazon soap interface using php

Hi i am trying to use soap to get results from amazon, and i havent tried this before so i was trying some sample code. The problem is i get an error.
the code is this:
<?php
#Use the NuSOAP php library
//require_once('lib/nusoap.php');
$params->AWSAccessKeyId = AMAZON_API_KEY;
$params->Request->SearchIndex = 'Books';
$params->Request->Keywords = 'php5';
$amazon = new SoapClient('http://webservices.amazon.com/AWSECommerceService /AWSECommerceService.wsdl');
$result = $amazon->itemSearch($params);
echo $result;
?>
and this is the error i get when i run it. thanx for your time
Fatal error: Uncaught SoapFault exception: [aws:Client.MissingParameter] The request must contain the parameter Signature. in C:\wamp\www\amasearch.php:11 Stack trace: #0 [internal function]: SoapClient->__call('itemSearch', Array) #1 C:\wamp\www\amasearch.php(11): SoapClient->itemSearch(Object(stdClass)) #2 {main} thrown in C:\wamp\www\amasearch.php on line 11
Weird. The WSDL doesn't have a signature parameter for any type. BUT, I found this in Amazon dev forums. Recommend you to check it out (also, if you develop using amazon services, keep that resource at hand
https://forums.aws.amazon.com/ann.jspa?annID=483
Looks like security gates for services are now taller and bigger, mate
EDIT: This question link to some example in C#. Maybe it can help you out Amazon (AWS) - The request must contain the parameter Signature
And this is an example in AWS forums with PHP https://forums.aws.amazon.com/message.jspa?messageID=149715

Categories