Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gravity Forms API always 401

I am trying to use the gravity forms rest api, https://www.gravityhelp.com/documentation/article/web-api/ but I receive a 401 error no matter what I try. I've tried using all the methods listed in the documentation and in Steven Henty's article, https://www.stevenhenty.com/gravity-forms-api/ but it doesn't seem to work.

If I am logged into a wordpress site as administrator should I not be able to use a link like:

http://mydomain/gravityformsapi/forms/

Thank you for any suggestions.

like image 789
grmdgs Avatar asked Aug 12 '16 20:08

grmdgs


3 Answers

For mine case it was that I haven't clicked the update button "Web API" Tab.

Make sure you click update button , although it does show the API Key's but still you have to click update button to enable API.

like image 186
Sanjeev Singh Avatar answered Oct 30 '22 09:10

Sanjeev Singh


I was getting the same thing due to some weirdness about the route endpoint. When calculating the signature you don't use a trailing slash on the route: forms/1.

But you do use a trailing slash in the URL (otherwise I got a 301 Moved Permanently):

http://demo.gravityforms.com/gravityformsapi/the_route/?api_key...

It looks odd to have /?api_key... but that is what works for me.

Here's the ruby example I was using with the demo credentials:

GravityFormsAPI.generate_URL(site: 'demo.gravityforms.com', route: 'forms/1', public_api_key: '5b225f8382', private_api_key: 'fc6d1bc71d2ebfc')

Hope this helps.

like image 2
jmosesman Avatar answered Oct 30 '22 10:10

jmosesman


Sometimes i received intermittent 401 error after a lot of research i find this article

Azure DocumentDB Intermittent 401 error when querying REST API via Obj-c

If the signature contains + sign i received 401 error

Maybe that help other person

Sorry for my english writing

like image 1
Philippe Michaud Avatar answered Oct 30 '22 10:10

Philippe Michaud