Skip to main content
Skip table of contents

Creating Your First REST Query

You probably know how to create a Query at this point, so quickly head over to the Queries tab and click the Create button:

Create a new Query

Once you’ve selected “REST Countries” as the Datasource for your Query, you’ll see that it’s different from creating SQL Queries. Instead of an editor for an SQL Statement, you will now see the base URL of your REST Datasource, and a field for a path that will be appended to it. Just like with SQL, you can use parameters here:

Creating a REST Query

#

Field

Value

1

Name

Countries per region

2

Datasource

REST Countries

3

REST URL

/region/:region

Click Create Query to save. Go to a Confluence page and try it out! Insert the PocketQuery macro again. In the macro editor, specify a value for the regional parameter. Example: Europe

Configuring the PocketQuery macro

There we go! Our first REST Query presents us a table of data:

Confluence page with REST data

But what’s this? Looks like there’s some data in our result that is displayed weirdly. Also, there are a lot of columns that we actually don’t need. So, let’s learn how we can format the result of a Query to fit our needs.

Continue with “Filtering the Result of Your Query With a Converter

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.