question

naszamuza avatar image
0 Likes"
naszamuza asked

Problem with sandbox request

Hi, I've write this code: use \Httpful\Request; class fullfil_pol_data{ public $name='1dzien'; public $marketplace='EBAY_PL'; public $category=array('name' => 'ALL_EXCLUDING_MOTORS_VEHICLES'); public $czas_wysylki=array('value'=> 1, 'unit'=>'DAY'); } class aukcja{ public $ilosc; public $cat_id; public $format; public $opis; } class token{ public $token; private $duration; private $starts; public function __construct($t, $d){ $this->token=$t; $this->duration=$d; $this->starts=time(); } public function check(){ if($this->duration+$this->starts >= time()-15*60) ibej::get_token(); } } class ibej{ private $token; public function get_token() { $url=' https://api.sandbox.ebay.com/identity/v1/oauth2/token'; $req= Request::post($url)->addHeader('Content-Type', 'application/x-www-form-urlencoded') ->addHeader('Authorization', 'Basic '.PASSES) ->body("grant_type=client_credentials&redirect_uri=Marketing_Desig-Marketin-wystaw-blzyg&scope= https://api.ebay.com/oauth/api_scope")->send(); $this->token = new token($req->body->access_token, $req->body->expires_in); var_dump($this->token); } /*$url=' https://api.sandbox.ebay.com/sell/inventory/v1/offer'; //$req= Request::post($url)->addHeader('Authorization', 'Bearer '.$token) // ->addHeader('X-EBAY-C-MARKETPLACE-ID', 'EBAY-PL') */ public function post_fullfilment_policy() { $url=' https://api.sandbox.ebay.com/sell/account/v1/fulfillment_policy'; $test= new fullfil_pol_data; $req= Request::post($url)->addHeader('Authorization', 'Bearer '.$this->token->token) ->addHeader('X-EBAY-C-MARKETPLACE-ID', 'EBAY-US') ->body(json_encode($test))->send(); var_dump($req); } } $ibej_api = new ibej; $ibej_api->get_token(); $ibej_api->post_fullfilment_policy(); I have no problem with getting token, problems starts when I try to create fullfilment policy with my *ibej_api->post_fullfilment_policy()* method. Then I recive following error: ["errorId"]=> int(2003) ["domain"]=> string(6) "ACCESS" ["category"]=> string(11) "APPLICATION" ["message"]=> string(14) "Internal error" ["longMessage"]=> string(106) "There was a problem with an eBay internal system or process. Contact eBay developer support for assistance" } } } ["raw_body"]=> string(222) "{"errors":[{"errorId":2003,"domain":"ACCESS","category":"APPLICATION","message":"Internal error","longMessage":"There was a problem with an eBay internal system or process. Contact eBay developer support for assistance"}]}" Is any mistake in my application? Maybe is still problem with sandboxAPI?
sandboxerror 2003
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
lester_developerprogram avatar image
0 Likes"
lester_developerprogram answered
Marking Accepted due to lack of activity
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.