简体   繁体   中英

Create Listing in Etsy using PHP api not working

I'm creating a listing into Etsy using php oAuth.I'm sending following params to api call "quantity,title,description,price,who_made,when_made,is_supply". I'm following the document as reference here

This is the process flow

  1. Authenticating with etsy using oAuth.

  2. Getting scopes using this api call https://openapi.etsy.com/v2/oauth/scopes

These are working fine.But while creating listing i'm getting following error.

"Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect)"

3.The process I followed for create listing

  $url = "https://openapi.etsy.com/v2/listings/";

  $params = array('description' => 'thisisdesc', 'price'=>'1.00', 'quantity'=>'2', 'title'=>'thisistitle', 'who_made'=>'collective', 'is_supply'=>'false','when_made'=>'2010_2015', 'category_id' => '69105467','shipping_template_id' => '110906760173');
  $data = $oauth->fetch($url, $params , OAUTH_HTTP_METHOD_POST);
  $json = $oauth->getLastResponse();
  print_r($json);

It displays error message.Invalid auth/bad request.

Any ideas/suggestions please.

Change

$url = "https://openapi.etsy.com/v2/listings/";

to

$url = "https://openapi.etsy.com/v2/listings";

The extra / at the end may be causing the issue

Can you try removing the '/' and if possible show the response details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM