Google Groups

Re: 403 Forbidden while creating a Coupon


Zach Dec 8, 2011 8:16 PM
Posted in group: Etsy API
Not too sure whether this matters, but your url looks like you are passing the variables in the url as get variables. You may need to pass it to etsy through post variables where the data is passed within the body of the http request, rather than through the url. (http://stackoverflow.com/questions/504947/when-should-i-use-get-or-post-method-whats-the-difference-between-them)



Zach 

On Fri, Dec 9, 2011 at 12:03 PM, SnakeO <jake...@gmail.com> wrote:
Thanks for the quick reply Zach! I tried again with POST:

POST /v2/shops/6440761/coupons?
limit=100&method=POST&api_key=emt8n1w5dda7qdq7vwypzlqe&coupon_code=TESTCOUPON&pct_discount=35&free_shipping=true&oauth_consumer_key=emt8n1w5dda7qdq7vwypzlqe&oauth_signature_method=HMAC-
SHA1&oauth_nonce=17851789844ee187efe7b063.58259997&oauth_timestamp=1323403247&oauth_version=1.0&oauth_token=22340ce1509d9c53878af969598341&oauth_signature=MVugsrpz0GBAwkyXh3HQe12ipyY
%3D HTTP/1.1
User-Agent: PECL-OAuth/1.2.2
Host: openapi.etsy.com
Accept: */*

With this response:

HTTP/1.1 403 Forbidden
Date: Fri, 09 Dec 2011 04:00:48 GMT
Server: Apache
X-Error-Detail: This method not accessible to restricted API key.
X-Etsy-Request-Uuid: CC0EJ2TLsPfmnjh-j-IRiwn37oZE
Content-Length: 49
X-Cnection: close
Content-Type: text/plain;charset=UTF-8

This method not accessible to restricted API key.

I made sure that my oauth_token was valid by re-issuing it, so I
definitely have shops_rw permissions. I'm so sad, I'm on a roll and I
got stuck on this for a while now.

On Dec 8, 9:54 pm, Zach <zach.ch...@gmail.com> wrote:
> You need to use a POST request with the variables as POST variables (http://www.etsy.com/developers/documentation/reference/coupon- The HTTP
> method for  create_coupon is POST.)
>
> Additionally, here are some things you need to be aware about when creating
> a coupon
>
> - coupon_code has to be all capitalized and only alphabets and numeric
> characters seem to be allowed.
>
> - pct_discount needs to be an integer value (i think).
>
> Hope this helps!
>
> Zach
>
>
>
>
>
>
>
> On Fri, Dec 9, 2011 at 11:47 AM, SnakeO <jakech...@gmail.com> wrote:
> > I'm creating a Coupon. I have these permissions:
>
> > email_r
> > transactions_r
> > shops_rw
>
> > Here's a dump of the URL call:
> > GET /v2/shops/6440761/coupons?
>
> > limit=100&method=POST&coupon_code=couponcodetest&pct_discount=35.5&free_shi pping=true&oauth_consumer_key=emt8n1w5dda7qdq7vwypzlqe&oauth_signature_meth od=HMAC-
>
> > SHA1&oauth_nonce=15368668144ee183851cc4d5.64468046&oauth_timestamp=13234021 17&oauth_version=1.0&oauth_token=22340ce1509d9c53878af969598341&oauth_signa ture=bKn65q
> > %2FDRAlfHg7mj29b9bfCEZ0%3D
>
> > User-Agent: PECL-OAuth/1.2.2
> > Host: openapi.etsy.com
> > Accept: */*
>
> > (this is a test shop that I use , it's not in a sandbox).
>
> > Coupon API says all I need is the shops_rw permission, but I get this
> > back:
>
> > Date: Fri, 09 Dec 2011 03:41:57 GMT
> > Server: Apache
> > X-Error-Detail: This method not accessible to restricted API key.
> > X-Etsy-Request-Uuid: bMa0263xgD7XtSQ02UqP0KLO54UL
> > Content-Length: 49
> > X-Cnection: close
> > Content-Type: text/plain;charset=UTF-8
>
> > This method not accessible to restricted API key.
>
> > Loving the Etsy API. Help Please
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Etsy API V2" group.
> > To post to this group, send email to etsy-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > etsy-api-v2...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/etsy-api-v2?hl=en.

--
You received this message because you are subscribed to the Google Groups "Etsy API V2" group.
To post to this group, send email to etsy-...@googlegroups.com.
To unsubscribe from this group, send email to etsy-api-v2...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/etsy-api-v2?hl=en.