
The following options for the types of API requests you can make become available:
GET
allows you to retrieve data.POST
allows you to create new data.PUT
allows you to update data by replacing it.PATCH
allows you to update data by modifying it.DELETE
allows you to remove an object specified in the URL request.
For this example, use a GET
request to retrieve data from the Typicode API.
Now that the URL action has your request and the Get Contents of URL action is set up to GET
data, you’re ready to make the API request.
Note: When the Get Contents of URL action is switched to POST
, PUT
, or PATCH
, a new parameter called Request Body is added. Request Body allows you to send JSON, a Form, or a File to the API as part of your request. This lets you enter new data manually or by using variables so you can send the data to the API for creating, replacing, or modifying an entry.
To test the shortcut, click Intro to using JSON in Shortcuts on Mac.