When trying to post a message for a team, i get the following issue:
Code: Select all
https://ws.maniaplanet.com/teams/7148/links/ ; Route not found "/teams/7148/links
Code: Select all
Error! HTTP Response: 400 Bad Request API Response: Invalid object property "0" (400)
Code: Select all
<?php
/**
* Maniaplanet Web Services SDK for PHP
*
* @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
* @author $Author: maximeraoust $:
* @version $Revision: 2 $:
* @date $Date: 2011-09-08 18:03:11 +0200 (Thu, 08 Sep 2011) $:
*/
require_once __DIR__.'/libraries/autoload.php';
try
{
$servers = new Maniaplanet\WebServices\Links('','', '');
$url="http://maniamatch.maniaplanet.com/club-link?team=68facfc716c19445c5671bf1376b2b6a-7148";
$requred_string = substr(strrchr($url, "-"), 1);
//echo $requred_string;
$teamId = $requred_string;
$link = "http://lynx.tmfserver.com";
$name = "Website";
$category = Maniaplanet\WebServices\Links::CATEGORY_URL;
$isFeatured = false;
$list = $servers->createForTeam($teamId, $link, $name, $category, $isFeatured);
echo $list;
var_dump($list);
}
catch(\Maniaplanet\WebServices\Exception $e)
{
echo "Error!\n";
printf('HTTP Response: %d %s', $e->getHTTPStatusCode(),
$e->getHTTPStatusMessage());
echo "\n";
printf('API Response: %s (%d)', $e->getMessage(), $e->getCode());
echo "\n";
}
echo "\n";
?>