question

jp_as23 avatar image
0 Likes"
jp_as23 asked

PHP Code. Cant get item condition policies .

PHP code API ebay.
I can't get condition Item with API getItemConditionPolicies. It return ssl error:
"SSL read: error:00000000:lib(0):func(0):reason(0), errno 104" .
This is my code. Please help me!
$url = 'https://api.ebay.com/sell/metadata/v1/marketplace/EBAY_US/get_item_condition_policies?filter=categoryIds:{181923|90638}';
    $headers = [
        'Authorization:Bearer ******',
        'Accept:application/json',
        'Content-Type:application/json',
    ];
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL            => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER     => $headers,
        CURLOPT_CUSTOMREQUEST  => 'GET',
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_SSL_VERIFYHOST => false,
        CURLOPT_AUTOREFERER    => true,  
        CURLOPT_CONNECTTIMEOUT => 120,
        CURLOPT_TIMEOUT        => 120,   
        CURLOPT_MAXREDIRS      => 10,   
    ));
    $response = curl_exec($curl);
    $err = curl_error($curl);
    curl_close($curl);
    var_dump($err);
    var_dump($response);
itemspecificsconditionconditionid-condition-use
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
jp_as23 avatar image
0 Likes"
jp_as23 answered
You must URL-encode the category ID values of the filter parameter. The example shown encodes the ID list of following parameter:
filter=categoryIds:{181923|90638} <=> filter=categoryIds%3A%7B181923%7C90638%7D
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.