Uploading an image when creating a listing. Keep getting 403 error. (PHP)

215 views
Skip to first unread message

Marty Sainty

unread,
Nov 24, 2013, 11:23:24 AM11/24/13
to etsy-...@googlegroups.com
When creating a listing with an image I'm getting the following error

'Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect); oauth_problem=signature_invalid&debug_sbs=POST&https%3A%2F%2Fopenapi.etsy.com%2Fv2%2F%2Flistings&category_id%3D69150455%26description%3Dexample%2520desc%26image%3Dme.jpg%26is_supply%3D0%26method%3DPOST%26oauth_consumer_key%mykey%26oauth_nonce%3noncebell14.57664651%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1385309342%26oauth_token%3Dhippadybllooji1%26oauth_version%3D1.0%26price%3D0.2%26quantity%3D1%26shipping_template_id%3D1jijiji580%26title%3Dthe%2520mans%2520%2520product%26when_made%3Dmade_to_order%26who_made%3Di_did'

These are the image file parameters being parsed in.

image=>array('name'=>'me.jpg','type'=>'image/jpeg','tmp_name'=>'C:\Users\sainty\Desktop\me.jpg','error'=> 0,'size'=> 11302);

I've also tried image=>array($_FILES['image']); and returns the same error.

When updating an existing listing with ListingImage using: array('@image'=>'@C:\Users\sainty\Desktop\me.jpg';type=image/jpeg'); it works just fine.

Can you provide any advice on where I'm going wrong?

cheers,

Marty

Paul Wright

unread,
Nov 24, 2013, 6:24:12 PM11/24/13
to etsy-...@googlegroups.com
Hi Marty,

The error you're seeing ("oauth_problem=signature_invalid") is related to the OAuth HMAC signing of your request. Looking at your debug_sbs value I note that you have a double backslash in the endpoint URL - no guarantees that this the problem but try fixing that first:

https://openapi.etsy.com/v2//listings (try /v2/listings instead)

If that doesn't help then try making an OAuthed signed request to a simpler API endpoint and confirm that part is working as you expect.

Cheers,

Paul.


On Sun, Nov 24, 2013 at 11:23 AM, Marty Sainty <sainty1...@hotmail.co.uk> wrote:
When creating a listing with an image I'm getting the following error

'Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect); oauth_problem=signature_invalid&debug_sbs=POST&https%3A%2F%2Fopenapi.etsy.com%2Fv2%2F%2Flistings&category_id%3D69150455%26description%3Dexample%2520desc%26image%3Dme.jpg%26is_supply%3D0%26method%3DPOST%26oauth_consumer_key%mykey%26oauth_nonce%3noncebell14.57664651%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1385309342%26oauth_token%3Dhippadybllooji1%26oauth_version%3D1.0%26price%3D0.2%26quantity%3D1%26shipping_template_id%3D1jijiji580%26title%3Dthe%2520mans%2520%2520product%26when_made%3Dmade_to_order%26who_made%3Di_did'


These are the image file parameters being parsed in.

image=>array('name'=>'me.jpg','type'=>'image/jpeg','tmp_name'=>'C:\Users\sainty\Desktop\me.jpg','error'=> 0,'size'=> 11302);

I've also tried image=>array($_FILES['image']); and returns the same error.

When updating an existing listing with ListingImage using: array('@image'=>'@C:\Users\sainty\Desktop\me.jpg';type=image/jpeg'); it works just fine.

Can you provide any advice on where I'm going wrong?

cheers,

Marty

--
You received this message because you are subscribed to the Google Groups "Etsy API V2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etsy-api-v2...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Marty Sainty

unread,
Nov 25, 2013, 3:11:08 PM11/25/13
to etsy-...@googlegroups.com
Hey Paul,

Cheers for the reply, I haven't had any problems creating listings without the image. I did change the incorrect url string but I'm still receiving the 403 error.

Could it have anything to do with the fact that I'm testing on localhost from the laptop?

Matt Graham

unread,
Nov 27, 2013, 8:57:41 PM11/27/13
to Etsy API V2
Hi Marty,

On Mon, Nov 25, 2013 at 3:11 PM, Marty Sainty <sainty1...@hotmail.co.uk> wrote:
Hey Paul,

Cheers for the reply, I haven't had any problems creating listings without the image. I did change the incorrect url string but I'm still receiving the 403 error.

Could it have anything to do with the fact that I'm testing on localhost from the laptop?

If array('@image'=>'@C:\Users\sainty\Desktop\me.jpg';type=image/jpeg'); works for adding a listing image to an existing listing, try using that same syntax (with the '@' prefixes) try using that when creating a new listing as well.

Thanks,
Matt
Reply all
Reply to author
Forward
0 new messages