you could gain access to new functionalities, and the possibilities to create new more advanced scripts expand.

In this post we discuss:

What Is REST?

What we want to do with the data is usually decided by whatHTTP methodthat you use.

iPhone 16e with iPhone 16 Plus and iPhone 16 Pro in hand against grey wall.

Now, let’s get started with our first API call!

But methods like POST and SET usually require that you click and expand the row to get more information.

That’s the basics for reading the documentation.

An Excel table with a named range.

Now that’s clear, it’s time to start using REST APIs with PowerShell.

Now, let’s get started with PowerShell.

You have now successfully made your first REST API call.

Article image

You’re going to learn how to create a JSON object that you might POST to the /pet endpoint.

Let’s start out by creating a hashtable that we can later convert to a JSON object.

Raw JSON should be avoided in PowerShell scripts becaise it’s limiting its capabilities.

The most essential information about the REST API endpoints.

Using PUT

The PUT method updates already existing data.

If we’re calling an endpoint more than once, then create a function for it.

Summary

Learning how to use REST APIs is mainly about learning to read the documentation.

The REST endpoint that can create a new pet object.

{petId} is actually a parameter that takes an integer.

How the JSON should look if you expanded the POST /pet row in the documentation.