💾 Archived View for pwshnotes.flounder.online › gemlog › 2023-07-18-web-api-articles.gmi captured on 2023-07-22 at 16:20:35. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Web API Articles

From time to time I need to work with web APIs. These normally allow computers to communicate online. But, it might be necessary for people to work with APIs to connect a business to a new service or to automate tasks.

Below are some articles that I found helpful while learning about APIs.

HTTP Methods

RESTful APIs are built on HTTP methods. It is important to understand what HTTP methods are so that you can understand how different technologies relate and build on each other. An HTTP method is part of an HTTP message, and some articles talk about methods in the section on messages. HTTP methods are sometimes called verbs.

Representational state transfer (REST) | Wikipedia

HTTP Request Messages | Wikipedia

HTTP Messages | Mozilla Developer Network

HTTP Methods | W3Schools

Finding Undocumented APIs

A journalist from The Markup wrote an introduction to APIs. In particular, the author focused on undocumented APIs. These are APIs from large companies which are available to the public but which are mostly used by the company itself.

One useful website mentioned was cURL Converter. This takes cURL commands as input and outputs web requests in a coding language such as Python or PowerShell. This is useful because the Developer Tools in Firefox and Chrome can capture and output a request as a cURL command. So, there is a way to go from a real request to working code in a few steps.

Finding Undocumented APIs | Inspect Element

Convert curl commands to code | cURL Converter

Basic Types of API Requests

This short YouTube video gives an overview of the basic types of API requests (API architectural styles). You are most likely to encounter a RESTful API while interacting with a service. However, other types are used in specialized circumstances.

Top 6 Most Popular API Architecture Styles | ByteByteGo | YouTube

JSON Web Tokens

JSON Web Tokens (JWT) are often used by RESTful APIs to authenticate requests.

JSON Web Token | Wikipedia

Introduction to JSON Web Tokens | jwt.io

Postman

One program I found useful was the Postman app. This allows you to build and store API templates in a graphical development environment. This helps people organize and test their API requests.

Download App | Postman

cURL

curl is a command-line tool that can be used to interact with web APIs. The command-line nature allows curl commands to be used in shell scripts like batch files or Bash scripts. Most operating systems come with a version of curl preinstalled.

If you need help with curl, try asking on Stack Overflow.

cURL

curl tag | Stack Overflow

PowerShell Cmdlets

I prefer to use PowerShell for scripting. Here is the help article for the API cmdlet in PowerShell.

Invoke-RestMethod | Microsoft Learn

curl Alias in PowerShell | cURL

Created: Tuesday, July 18, 2023

Updated: Tuesday, July 18, 2023