REST Assured · Example Payload

Rest Assured Get User Example

REST Assured example: GET request with JSONPath assertion using given-when-then pattern.

Functional TestingTestingJavaAPI TestingAutomation

Rest Assured Get User Example is an example object payload from REST Assured, with 7 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

descriptionlanguagelibrarypatternrequestresponsejavaCode

Example Payload

rest-assured-get-user-example.json Raw ↑
{
  "description": "REST Assured example: GET request with JSONPath assertion using given-when-then pattern.",
  "language": "java",
  "library": "io.rest-assured:rest-assured:6.0.0",
  "pattern": "given-when-then",
  "request": {
    "method": "GET",
    "baseUri": "https://api.example.com",
    "path": "/v1/users/{id}",
    "pathParameters": {
      "id": "42"
    },
    "headers": {
      "Accept": "application/json",
      "Authorization": "Bearer {{ACCESS_TOKEN}}"
    }
  },
  "response": {
    "statusCode": 200,
    "contentType": "application/json",
    "bodyAssertions": {
      "$.id": 42,
      "$.name": "Jane Doe",
      "$.email": "jane.doe@example.com"
    }
  },
  "javaCode": "import static io.restassured.RestAssured.*;\nimport static org.hamcrest.Matchers.*;\n\ngiven()\n    .baseUri(\"https://api.example.com\")\n    .header(\"Authorization\", \"Bearer \" + accessToken)\n    .pathParam(\"id\", 42)\n.when()\n    .get(\"/v1/users/{id}\")\n.then()\n    .statusCode(200)\n    .contentType(ContentType.JSON)\n    .body(\"id\", equalTo(42))\n    .body(\"name\", equalTo(\"Jane Doe\"))\n    .body(\"email\", equalTo(\"jane.doe@example.com\"));"
}

Work with this as data

Every example here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for examples

4 MCP tools reach this
  • find_examplesBrowse and filter every example in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This example
curl "https://apis.io/api/v1/examples/rest-assured-get-user-example"
All examples
curl "https://apis.io/api/v1/examples?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.