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
What Does the 💦 Water Emoji Mean?
What to Do When You're Demotivated to Workout | Code 5
Barstool Sports Gif
Fan Van Ari Alectra
Angela Babicz Leak
Jeremy Corbell Twitter
Practical Magic 123Movies
Riegler & Partner Holding GmbH auf LinkedIn: Wie schätzen Sie die Entwicklung der Wohnraumschaffung und Bauwirtschaft…
CSC error CS0006: Metadata file 'SonarAnalyzer.dll' could not be found
Fallout 4 Pipboy Upgrades
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Strange World Showtimes Near Amc Braintree 10
Xm Tennis Channel
Prices Way Too High Crossword Clue
Morgan Wallen Pnc Park Seating Chart
How Much Is Tj Maxx Starting Pay
Uhcs Patient Wallet
Animal Eye Clinic Huntersville Nc
Craiglist Galveston
Powerball winning numbers for Saturday, Sept. 14. Check tickets for $152 million drawing
Full Standard Operating Guideline Manual | Springfield, MO
bode - Bode frequency response of dynamic system
Loft Stores Near Me
Pokemon Unbound Shiny Stone Location
BMW K1600GT (2017-on) Review | Speed, Specs & Prices
Walgreens 8 Mile Dequindre
Times Narcos Lied To You About What Really Happened - Grunge
Craigslist Brandon Vt
Jailfunds Send Message
Best Restaurants Ventnor
Busch Gardens Wait Times
FSA Award Package
Kempsville Recreation Center Pool Schedule
Craigslist Cars And Trucks Mcallen
Gerber Federal Credit
Puerto Rico Pictures and Facts
Sun Haven Pufferfish
Dreammarriage.com Login
Leatherwall Ll Classifieds
Main Street Station Coshocton Menu
3496 W Little League Dr San Bernardino Ca 92407
Telugu Moviez Wap Org
Uvalde Topic
All Obituaries | Sneath Strilchuk Funeral Services | Funeral Home Roblin Dauphin Ste Rose McCreary MB
ACTUALIZACIÓN #8.1.0 DE BATTLEFIELD 2042
Spurs Basketball Reference
Where and How to Watch Sound of Freedom | Angel Studios
How To Connect To Rutgers Wifi
Hcs Smartfind
login.microsoftonline.com Reviews | scam or legit check
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.