PDA

View Full Version : Solved Microsft Translation API by Azure: The required field \u0027client_id\u0027 is missing.



mario06
26-12-11, 17:16
Any Help here?

Starting test for Microsft Translation API by Azure

Full token:
{"error":"invalid_request","error_description":"ACS90011: The required field \u0027client_id\u0027 is missing. \r\nTrace ID: 71501a25-d0b9-4ff5-898c-fff921164a45\r\nTimestamp: 2011-12-26 17:13:45Z"}

PS. When I insert my Client ID I'm getting a white page, when I remove my Client ID the translations work (no white page) BUT the error above remains either way.

r.dziadusz
27-12-11, 12:43
Hi
First I want to apologize you there is a little error in in test file, please use this:


<?php
require_once('./global.php');

function get_token(){
global $vbulletin;
$obj_connection = curl_init();
$arr_query_bits = array (
'grant_type' => 'client_credentials',
'scope' => 'http://api.microsofttranslator.com',
'client_id' => $vbulletin->options['vbenterprisetranslator_Microsoft_key'],
'client_secret' => $vbulletin->options['vbenterprisetranslator_Microsoft_secret']
);
$str_query = http_build_query($arr_query_bits);

curl_setopt($obj_connection, CURLOPT_URL, 'https://datamarket.accesscontrol.windows.net/v2/OAuth2-13');
curl_setopt($obj_connection, CURLOPT_HEADER, 0);
curl_setopt($obj_connection, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($obj_connection, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($obj_connection, CURLOPT_POSTFIELDS, $str_query);
curl_setopt($obj_connection, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($obj_connection, CURLOPT_POST, TRUE);
print_r('Full token: </br>'.curl_exec($obj_connection).'</br></br>');
$token = json_decode (curl_exec($obj_connection));
curl_close($obj_connection);
return 'Authorization: Bearer '.$token->{'access_token'};
}

echo 'Starting test for Microsft Translation API by Azure<br/><br/>';
$connection = curl_init();
curl_setopt($connection, CURLOPT_URL, 'http://api.microsofttranslator.com/V2/Ajax.svc/Translate?&from=pl&to=en&text=Witaj!');
curl_setopt($connection, CURLOPT_HEADER, 0);
curl_setopt($connection, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($connection, CURLOPT_HTTPHEADER, array(get_token()));
$str_response = curl_exec($connection);
$time = microtime(true) * 1000;
$result = curl_exec($connection);
$time = microtime(true) * 1000 - $time;
echo 'Test result: '.$result."<br/>\n";
echo 'Test error: '.curl_error($connection)."<br/>\n";
curl_close($connection);
echo 'Connection time (ms): '.$time;
?>



Please run this test and show me the result

mario06
27-12-11, 16:55
Tested and still the same.

Starting test for Microsft Translation API by Azure

Full token:
{"error":"invalid_request","error_description":"ACS90011: The required field \u0027client_id\u0027 is missing. \r\nTrace ID: 724fd4ca-333c-4c54-b940-c5af56900488\r\nTimestamp: 2011-12-27 16:55:17Z"}

How about this other problem? -> PS. When I insert my Client ID I'm getting a white page, when I remove my Client ID the translations work (no white page) BUT the error above remains either way. Infact it gets turned off in auto in trans. availability?!?

Microsoft Translation API Available
Please see description of first option in this group. NO

r.dziadusz
28-12-11, 10:33
It happens becouse, if you delete client id the vBET will not try to use Microsoft Translation API and just use other available API's otherways vBET try to use but something goes wrong and (missing client_id) and translation cannot be done.

Please make sure you:
put correct values in: Microsoft Comercial Translation API key by Azure

mario06
28-12-11, 15:04
I'm putting in my Client ID which I get from here.
http://i43.tinypic.com/1pigef.jpg

r.dziadusz
28-12-11, 18:31
Yes you are using correct one:
-have you upload test file into your forum root folder?

If yes, could you please send me your access details to your admincp and ftp in order to check all your issues?

mario06
28-12-11, 20:12
i sent you a pm regards

mario06
01-01-12, 06:55
Still waiting :)
Happy New Years

mario06
02-01-12, 09:16
PM Sent days ago!!
Regards

basketmen
02-01-12, 16:07
PM Sent days ago!!
Regards

its looks like the staffs are in new year vacation right now, my important thread are still not get answers too,

i know its little sucks, so many businesses are in vacation right now, but its normal lets be patient

r.dziadusz
02-01-12, 23:04
Hi
You have sent me your acces and I've checked it out. Firstly obtaining token is now working fine, but translation it self, wont becouse of you PHP version.
In Microsoft by Azure we use function json_decode which is implemented since PHP version 5.2. You are currently using version 5.16 - you can see it in test microsoftbyazuretest.php
For vBET to work you need to upgrade your PHP to, at least, version 5.2.0

mario06
06-01-12, 08:01
I have no such update in my server update panel so now what?:


php The PHP HTML-embedded scripti... 5.1.6-24.... 5.1.6-27....
php-bcmath A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-cli Command-line interface for PHP 5.1.6-24.... 5.1.6-27....
php-common Common files for PHP 5.1.6-24.... 5.1.6-27....
php-dba A database abstraction layer ... 5.1.6-24.... 5.1.6-27....
php-devel Files needed for building PHP... 5.1.6-24.... 5.1.6-27....
php-gd A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-imap A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-ldap A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-mbstring A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-mysql A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-ncurses A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-odbc A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-pdo A database access abstraction... 5.1.6-24.... 5.1.6-27....
php-pgsql A PostgreSQL database module ... 5.1.6-24.... 5.1.6-27....
php-snmp A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-soap A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-xml A module for PHP applications... 5.1.6-24.... 5.1.6-27....
php-xmlrpc A module for PHP applications... 5.1.6-24.... 5.1.6-27....

basketmen
06-01-12, 09:41
simply ask your host to upgrade the PHP version to 5.2.x,

or pay someone to help upgrade it for you, like many services offer in Services Forum (http://forums.digitalpoint.com/forumdisplay.php?f=60)

or the other alternatives move to another host, or not using microsoft translation, the apertium translation i think better

r.dziadusz
06-01-12, 17:22
like basketman said, just ask your host provider, he either help you or give you "how to"information

mario06
09-01-12, 06:57
Like I posted above, I have an update available but not too 5.2 so asking my server is useless, isn't the micorsoft server going to cease? So is it worth it? How much does this cost with -> Services Forum (http://forums.digitalpoint.com/forumdisplay.php?f=60) , does google need this update too?
Regards

basketmen
09-01-12, 09:25
i think for $20-$30 few people will help, make backup first, but i think you only can upgrade php if using dedicated or vps server, we cant upgrade php with shared hosting

the other alternatives move to another host, or not using microsoft translation, the apertium translation i think better. I dont know about google v2

r.dziadusz
09-01-12, 11:13
isn't the micorsoft server going to cease
The old version of Microsoft translation API (without using json_decode) will have been closed by last march - so you can use it without upgrade your php, but Microsoft translation by Azure(new - with json_decode) was open few months ago and its definetely not about to cease

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Translations delivered by vBET Translator 4.9.2