Skip to content
Integrations

What Is an API? A Simple Guide for Business Leaders

Stefan Dusciuc
Stefan Dusciuc |

The term “API” is so common today that it’s even made its way into the dictionary. At a high level, an API (Application Programming Interface) functions like a website—but instead of showing visuals, it shares data. When it comes to moving information between systems, APIs are one of the safest and most efficient methods available.

Every API interaction has two parts: a request and a response.

Part 1. Request

A request is like typing a website address into your browser. There is a pattern to follow, and if you get it wrong, you won’t reach the right destination.

An API request typically includes three elements: an endpoint, headers, and sometimes a body.

https://wdc.spm.varicent.com/api/v1/users

Looks familiar? That’s because APIs use the same protocols as websites. This type of URL is often referred to as an endpoint.

Header example:

headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer icm-abc123',
  'Model': 'Testing'
}
 
Headers include important details that help the request go through. For example, the Authorization header usually includes an API key that grants access permissions.
 
Body example:
 
"importParams":{
                "query":"select * from 'Payee_'"
                ,"model":"Testing"
                ,"importType":"DBImport"
                ,"hasHeader":"True"
                ,"queryTimeout":"60"
            },
            "numLines":10
}
 
The body is where you send data to the system, which is common in more complex request types like POST. For simpler GET requests, a body usually isn't required. Post and Get requests are the most common request types.
 

Part 2. Response

The hard part is over. Once the request is ready, we metaphorically press enter and make the API call. If everything goes well, we receive a response. The most common response code we hope to see is 200, which means the request was successful and the data has been returned.
 
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 123,
  "name": "Sarah Martinez",
  "email": "sarah@example.com",
  "role": "sales_rep",
  "active": true
}
 
2xx - Success
200 OK - The request worked. This is the most common success response.
 
4xx - Client Errors
400 Bad Request - The server couldn’t understand the request. Usually a formatting or validation issue with the request.
 
5xx - Server Errors
500 Internal Server Error - Something broke unexpectedly on the response side. Think of it like the API’s version of a website crash.
 

Conclusion

And just like that, you've got the basics of how an API works: a request and a response. In practice, APIs come in many different shapes and sizes. If you'd rather not deal with the details, we're always here to help.

Share this post