Skip to content

Testing GLA endpoints with Postman

Miguel Pérez Pellicer edited this page May 6, 2022 · 5 revisions

Notice you can use this guide (the 3 first filters) instead of steps 2and 4

1. Create a free account and Install Postman

2. Getting the cookie as well as x-wp-nonce

This is necessary for auth purposes since postman is not using Wordpress at all. For getting both fields you should just enter into Google Listing and Ads dashboard for example, and then inspect some network call in order to get the fields.

Screenshot 2022-05-06 at 11 29 15

You can right click with the mouse over the field and select "copy value"

Screenshot 2022-05-06 at 11 31 57

3. Create the request in Postman

Open Postman and create a new request. The url is like

http://localdomain.test/wp-json/wc/gla/route-to-test

For example if my domain is https://ab11-94-43-39-97.ngrok.io and the route is mc/review I should write

https://ab11-94-43-39-97.ngrok.io/wp-json/wc/gla/mc/review

4. Paste the cookie and x-wp-nonce in Postman

Go to headers tab and create the next fields:

Field name: cookie Field value: cookie value you copied in step 2

Field name: x-wp-nonce Field value: x-wp-nonce value you copied in step 2

Screenshot 2022-05-06 at 11 33 59

5. Run the request