API Requests and Responses (2024)

The Buzz API responds to every request with an http status indicating whether the request was successful, along with a json response. The json response includes:

JSON elementDescriptionAlways Present
successBoolean with true=success, false=failureYes
payloadjson results of the request. For a GET request will include the results. For a POST or PUT will include the unique id of the object.No
messagePlain-text description of the resultNo
errorjson element with any error messages or warningsNo
idID of newly created object on POSTNo

The first element of any API response will be the "Success" element, which will either be true or false. Example:
"success": true

When a GET request successfully executes, the second element in the response will be the payload, which will contain the data requested. Example of a successful GET ot the right:

{ "success": true, "payload": { "user_id": 1, "first_name":"Danny" ... }}

When a POST successfully executes, the payload element will be a success message, and an id element will be returned indicating the unique id of the object that was created. Example of a successful POST to the right:

{ "success": true, "payload": "user updated with ID 4", "id": 4}

Successful PUT/DELETE Responses

When a DELETE or PUT request successfully executes, the "payload" element will be a list of messages and useful data for each affected object. Example of a successful POST to the right:

{ "success": true, "payload": [ { "id": 1, "success": false, "error_code": "AD_BAD_VALIDATION", "message": [ "ERROR: Error creating campaign_budget, field improperly formatted decimal" ] }, { "id": 30, "success": true, "message": "campaign updated successfully" } ], "errors": [ "ERROR: campaign update: 1 updated successfully, 1 with errors" ]}

Unsuccessful responses will aggregate all errors in the "errors" element, as shown in the example to the right:

{ "success": false, "payload": "Nothing found or problem with the query", "errors": { "ERROR: Nothing found matching those criteria", "WARNING: Something not so bad happened" }}

Note, if the only error condition resulting from a request was a WARNING, the request will have success=true, but will also have a non-empty errors element.

HTTP Codes

Buzz uses HTTP status codes to indicate whether a request was successful. If the response's HTTP code is 200, all worked well. The following codes represent other outcomes:

HTTP CodeMeaning
200OK
400Bad Request, method not supported by Buzz.
401Unauthorized, user doesn't have rights. See Accounts, Users, Roles, Permissions.
405Method not allowed by API. For example, some elements are read-only and cannot accept POST requests.
406Not acceptable, missing parameters or bad parameters. This is the most common error code when field validation fails for any reason.
409Conflict, thrown when an API request throws a WARNING and the request was made in strict mode. When not in "strict" mode a WARNING will return a 200. See: Using Extras for Fine-Tuning API Usage for more on strict mode.
429Rate limiting, thrown when an excessive number of requests are made in a short amount of time. Rate limiting is currently applied to the Report Queue and Authentication endpoints.
500Internal server error, generally problem with the database or system setup.

Updated over 4 years ago

API Requests and Responses (2024)

FAQs

What are API requests and responses? ›

API requests (submitted to an API endpoint) tell the endpoint to do something. Once the request is processed, the API endpoint sends a response. To make API requests, you must know the HTTP method, URL path, and parameters for the endpoint that you want to use.

What is the response type of API request? ›

○ API - Responses and response codes. Responses can come in 3 different output formats: JSON, XML or Text. To specify which kind of output you would like, you will find more information in this article.

What are the different responses of API? ›

Basics of API Responses

Headers provide additional metadata about the response, such as content type, encoding, and cache directives. The body contains the actual payload of the response, typically formatted in a specific data structure like JSON or XML.

How do I check my API request and response? ›

API testing flow is quite simple with three main steps:
  1. Send the request with necessary input data.
  2. Get the response having output data.
  3. Verify that the response returned as expected in the requirement.

What is an API with an example? ›

API integrations are software components that automatically update data between clients and servers. Some examples of API integrations are when automatic data sync to the cloud from your phone image gallery, or the time and date automatically sync on your laptop when you travel to another time zone.

What is a rest API example? ›

For example, a REST API would use a GET request to retrieve a record. A POST request creates a new record. A PUT request updates a record, and a DELETE request deletes one. All HTTP methods can be used in API calls.

What are the 4 types of API? ›

What are the different web API types?
  • Open APIs. Public APIs (or Open APIs) function through a set of tools, routines, and protocols for developing software applications. ...
  • Partner APIs. ...
  • Internal APIs. ...
  • Composite APIs.
May 2, 2023

How do I give an API response? ›

  1. The first element of any API response will be the "Success" element, which will either be true or false. ...
  2. When a GET request successfully executes, the second element in the response will be the payload , which will contain the data requested.

How many types of requests are in an API? ›

The most commonly used HTTP request methods are GET, POST, PUT, PATCH, and DELETE. These are equivalent to the CRUD operations (create, read, update, and delete).

Is rest an API? ›

A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.

What does API response mean? ›

An API Response is the data or information that is returned from a server when an API (Application Programming Interface) request is sent. It is typically in the form of a JSON or XML document and contains either a status (“o*k”, “error”, etc.) or data (e.g. a list of items).

How does API work? ›

Application programming interfaces (APIs) allow software programs to communicate with each other by sending and receiving API calls, or requests for information. These requests are initiated by an API client and accepted by an API endpoint.

What is the difference between a request and a response? ›

There are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server.

What counts as an API request? ›

One API call is used per request made, meaning when an email address or website domain is queried against any of the Enrichment API endpoints. A personal email, a corporate email, or a website domain lookup would all count equivalently as one API request. API requests can be by way of direct access (ex.

What are request and response parameters in API? ›

When making an API request, you can pass different parameters to the API endpoints to determine the response. There are several types of request parameters: header parameters, path parameters, query parameters, and request body parameters.

What are the two most common forms of responses from an API? ›

The most common formats found in modern APIs are JSON (JavaScript Object Notation) and XML (Extensible Markup Language).

Top Articles
4 Ways to Calculate Your Clients' Life Insurance Needs
What next for Florida insurance rates?
Nco Leadership Center Of Excellence
Google Sites Classroom 6X
Boggle Brain Busters Bonus Answers
Mail Healthcare Uiowa
Sunday World Northern Ireland
Our History | Lilly Grove Missionary Baptist Church - Houston, TX
How Many Cc's Is A 96 Cubic Inch Engine
Trini Sandwich Crossword Clue
Hca Florida Middleburg Emergency Reviews
Belly Dump Trailers For Sale On Craigslist
finaint.com
Hilo Hi Craigslist
Urban Dictionary: hungolomghononoloughongous
Xomissmandi
Amazing deals for DKoldies on Goodshop!
Craigslist Pinellas County Rentals
How To Level Up Roc Rlcraft
Nevermore: What Doesn't Kill
Outlet For The Thames Crossword
Att.com/Myatt.
Bella Bodhi [Model] - Bio, Height, Body Stats, Family, Career and Net Worth 
Scream Queens Parents Guide
Company History - Horizon NJ Health
Black Lion Backpack And Glider Voucher
How To Make Infinity On Calculator
Gas Prices In Henderson Kentucky
Goodwill Houston Select Stores Photos
Workday Latech Edu
4083519708
Best Weapons For Psyker Darktide
Labyrinth enchantment | PoE Wiki
Bella Thorne Bikini Uncensored
Nearest Ups Office To Me
Evil Dead Rise (2023) | Film, Trailer, Kritik
11301 Lakeline Blvd Parkline Plaza Ctr Ste 150
Complete List of Orange County Cities + Map (2024) — Orange County Insiders | Tips for locals & visitors
Seminary.churchofjesuschrist.org
Craigslist Com Panama City Fl
Kutty Movie Net
Owa Hilton Email
Payrollservers.us Webclock
Sea Guini Dress Code
Rise Meadville Reviews
Accident On 40 East Today
San Diego Padres Box Scores
Phunextra
Quest Diagnostics Mt Morris Appointment
Game Like Tales Of Androgyny
WHAT WE CAN DO | Arizona Tile
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6307

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.