AI, API & IntegrationsNov 27, 202616 min read

REST API Sample: Build and Verify a Scribe Integration

Learn how to read a REST API sample, verify Scribe endpoints, and test a documented integration before implementation.

SG

Sophie Grant

Email Signature Specialist, Scribe

Read the sample as a request-response contract

A REST API sample shows a conversation between a client and a server: your application sends a request, and the server returns a response. REST is an architectural style that uses HTTP and standard web protocols rather than a strict protocol such as SOAP. It gives you a uniform way to work with digital resources through web URLs, usually with structured JSON in the response.

Read the sample as a contract, not as a block of code to copy blindly. The request declares the action, destination, credentials, filters, and data you send. The response tells you whether the server processed that action and, when applicable, returns the data your integration must interpret. This separation lets you identify which parts are general REST conventions and which parts belong to the documented API you plan to call.

HTTP methods describe the intended action on a resource. GET commonly retrieves data, POST creates something, PUT replaces a resource, PATCH changes part of it, and DELETE removes it. The exact method for an endpoint belongs to that endpoint's reference documentation. REST also uses a stateless request model: each request carries the information the server needs, and requests are independent.

Your first pass through any sample should answer four questions:

  • What resource does the URL identify?
  • What action does the method request?
  • Which values must your client send?
  • What response can your client safely process?

Those questions give you a practical boundary. You can reuse the shape of a generic example, but you should replace its endpoint, fields, credentials, and response handling only after the target API documentation confirms them.

Get started with Scribe

Let AI build your signature — from a screenshot

Free 14-day trial — no credit card.

Identify every part of the REST request

A REST request usually has five parts: an endpoint, an HTTP method, headers, query parameters, and a body. A client may not use every part on every call. A GET request can retrieve a resource without a body, while a request that creates or changes data may need JSON fields in its body.

Use this reading order when you inspect a sample:

  1. Method: Identify the operation, such as GET or POST. The method is not decorative; it tells the server what kind of action you are requesting.
  2. Endpoint: Find the complete URL or path for the resource. Separate the base URL from the version and resource path so you know which part belongs to the API configuration.
  3. Headers: Look for metadata the server needs, such as the requested media type or an authentication token.
  4. Query parameters: Check whether the URL filters, paginates, or otherwise narrows the request. These values appear after a question mark as name-value pairs; separate multiple parameters with an ampersand.
  5. Body: Determine whether the call sends data. When a body is required, the documentation defines its JSON object and fields.

This order prevents a common mistake: treating a value in the example as universal when it may be a placeholder, a resource identifier, or a field required only for that endpoint.

Headers carry instructions and credentials separately from the resource data. An Accept header communicates the media type you want, an Authorization header carries an authentication token, and body parameters can be sent as a JSON object when the request requires them. Whether a particular API accepts a header, token format, or media type is an API-specific question, so do not transfer those details from a generic example into a Scribe call without checking the documentation.

Query parameters belong to the endpoint's documented input. For example, a generic URL might add ?status=active&limit=25, but those names and values are illustrative until the target reference defines them. Your client should encode parameter values correctly and preserve the distinction between a query parameter and a JSON body field. The two locations are not interchangeable.

The endpoint reference is the authority for the method and fields. Use it to build a small input record containing the exact path, required headers, permitted parameters, and body schema before writing integration logic.

Turn the sample into a request record before you adapt it. Write down the method and path on separate lines, then list each required header, query parameter, and body field with its documented type and condition. Mark values that your system supplies, such as an identifier or date, separately from values fixed by the API contract, such as a path segment or media type.

This record gives you a direct comparison point when a call fails. A missing header, misplaced parameter, or body field with the wrong shape is easier to locate when every input has a defined place. It also stops a generic example from quietly becoming your implementation specification: a placeholder stays visibly provisional until the target documentation gives it a confirmed name and meaning.

An infographic checklist of the five parts of a REST request: method, endpoint, headers, query parameters, and body. The items are shown in the reading order used to inspect a sample.
Reading the request in this order helps keep placeholders separate from confirmed API details.

Follow a labeled generic sample from client to server

A generic REST flow starts when your client sends an HTTP request to an endpoint. The request travels over HTTP or HTTPS, the server validates the input and performs the relevant processing, and the server returns a structured response. Your client then logs the result, renders it, stores it, or makes another call. If processing requires a database operation, the server may query or update its database before returning the response.

The following code is illustrative pseudocode, not a Scribe request. Every URL, field name, token, and response property is a placeholder. Use it to see the order of operations, not to infer Scribe endpoint behavior.

# Illustrative generic example - not a Scribe endpoint
curl --request GET \
  --url 'https://api.example.test/v1/resources?state=active' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <token-placeholder>'

# Illustrative response - field names are placeholders
HTTP/1.1 200 OK
Content-Type: application/json

{
  "items": [
    {
      "id": "resource-id-placeholder",
      "state": "active"
    }
  ]
}

The generic example has a clear sequence:

  • Client action: The client selects GET and sends a request to the placeholder resource URL.
  • Destination: The path identifies the resource, while the query string narrows the request with a placeholder filter.
  • Headers: Accept requests JSON, and Authorization carries a placeholder token. Neither header establishes how Scribe authenticates a call.
  • Server work: The server receives and validates the request, then performs the operation represented by the resource.
  • Response: The status line says the request succeeded, the response header describes the body, and the JSON object contains illustrative data.
  • Client handling: Your integration should inspect the status before reading the body, then map only documented response properties into your own records.

A complete sample is useful because it connects syntax to behavior. It also shows where the boundary lies: the flow is general REST guidance, while the resource path, authentication details, fields, status behavior, and response schema must come from the API you are using.

Interpret the response and status before using its data

A REST response gives your client a status code and headers, and it may also include a body. Successful responses do not all have the same body behavior: 2xx codes indicate successful processing, 200 OK commonly returns a body, 201 Created indicates successful resource creation, and 204 No Content indicates success without a response body.

Handle the status before deserializing data. The endpoint documentation determines which statuses and response fields apply to the call you are making.

Use a small response checklist in your prototype:

  • Confirm that the status belongs to an outcome your code handles.
  • Read headers only when your workflow needs them.
  • Parse a body only when the response includes one and the documentation defines its shape.
  • Treat a missing or unexpected field as a contract issue rather than silently assigning a meaning.
  • Record enough context to identify the request and outcome without exposing a credential.

This approach keeps successful empty responses separate from successful responses that contain data. It also gives you a place to handle documented errors before later steps consume incomplete records.

A StatRow infographic showing REST success statuses 200, 201, and 204. It states that 200 commonly returns a body, 201 indicates successful resource creation, and 204 indicates success without a response body.
Status handling determines whether the client should read, capture, or skip the response body.

Map the generic pattern to documented Scribe data

Our Scribe API manages email signatures, teammates, smart fields, folders, assets, and marketing campaigns. We use JSON over HTTPS, version the API under /v1, and document https://api.scribe-mail.com/v1 as the base URL. We offer a REST API for accessing Scribe data, including signature status and conversions, and we provide endpoints for data related to signatures and conversions.

That information gives you the starting boundary for a prototype, not a complete call. The generic example's placeholder resource must become a path documented for the Scribe resource you intend to use. The same rule applies to authentication, headers, query parameters, body fields, response properties, and accepted status codes. A resource category such as signature status or conversions does not, by itself, establish an endpoint path or payload shape.

Use this mapping process to turn a generic flow into a Scribe prototype:

  1. Select one documented resource. Start with the data your workflow needs, such as signature-related status or conversion information. Do not begin with a guessed URL.
  2. Copy the documented method and path. Keep the /v1 version boundary and the documented base URL separate from the resource path.
  3. Build the request from the reference. Add only the authentication method, headers, parameters, and body fields that the endpoint defines.
  4. Map the response deliberately. Record the documented status outcomes and response properties your downstream system needs.
  5. Mark every placeholder. A value such as an account identifier, campaign identifier, date range, or filter remains a placeholder until the reference tells you its name, type, and conditions.

REST API documentation explains authentication, request data, responses, and errors. Use those details to replace the generic sample one decision at a time rather than treating a visually similar example as proof that the call will work.

Keep three layers separate in your notes. The first layer is generic REST behavior: requests contain an action and destination, and responses report an outcome. The second layer is confirmed Scribe behavior: the documented base URL, /v1 versioning, JSON over HTTPS, and the Scribe resources and data categories described in the API documentation. The third layer is your integration design: how you store the response, trigger a follow-up action, or pass data into another system.

A placeholder can help you design the control flow, but it cannot confirm a Scribe field. Keep unconfirmed endpoint paths and payload properties out of production code until the Scribe reference defines them.

A five-step infographic for mapping a generic REST flow to documented Scribe data: select a resource, copy the method and path, build the request, map the response, and mark placeholders.
A documented resource and contract should replace each generic sample decision.

Verify the Scribe request before implementation

A Scribe integration is ready for implementation only after each request detail has a documented answer. Use this preimplementation check:

  • Endpoint: Does the documented path exist for the resource and operation you need?
  • Method: Does the reference assign GET, POST, PUT, PATCH, or another method to that path?
  • Authentication: What credential type does the documentation require, and where must your client send it?
  • Headers: Which media type and other headers are required or accepted?
  • Parameters: Which query names, formats, filters, or pagination values are documented?
  • Body: Is a body required, and what are the permitted field names, types, and conditions?
  • Response: What status outcomes, headers, body fields, and empty-body cases should your client handle?
  • Errors: What documented error responses should stop the workflow or produce a retry decision?

Documentation identifies the endpoints and fields to use and explains authentication, request data, responses, and errors. Keep a record of each answer beside the prototype so a later change can be checked against the same contract.

Test the smallest documented request before connecting it to a larger workflow. Send the call with a controlled input, inspect the status, compare the response shape with the reference, and confirm that your client handles both a response with content and an applicable empty response. Keep credentials outside source code and use the credential-handling process required by your environment.

Then test the complete path your integration will use. If the workflow retrieves data, transforms it, and sends it to another system, chain those requests in a test environment and confirm each transition. End-to-end API tests validate multi-endpoint user journeys by chaining requests and confirming that each request works.

Stop at the first mismatch. A different status, missing field, rejected parameter, or undocumented response is a reason to return to the reference and revise the request or the assumption behind it - not a reason to add an unverified fallback.

Capture the result of the test as an acceptance record for the prototype. Include the documented request you intended to send, the actual status received, the response shape your client parsed, and the next request in the workflow when the path contains multiple calls. Record any mismatch beside the affected endpoint rather than smoothing it over in application logic.

A useful record answers three practical questions:

  • Did the request use the documented method, path, credentials, and inputs?
  • Did the response match the documented status and body conditions?
  • Did the next step receive only fields that the preceding response defines?

Use that record as the release boundary for the prototype. If any answer is uncertain, keep the workflow in testing while you resolve the relevant documentation detail.

Choose between direct retrieval, webhooks, and CLI workflows

The integration path should follow the event and data shape your workflow needs. We integrate with CRM, data warehouses, or marketing tools through API and webhook connections. We provide real-time events through webhooks to Zapier, n8n, or your own systems, and we provide structured JSON through the CLI.

The comparison below is a selection aid, not a ranking. Choose the path whose trigger and output match your documented workflow.

Path How it starts What you receive Use it when
Direct API retrieval Your client sends a documented HTTP request to an endpoint. The endpoint's documented response, often structured JSON. Your workflow needs to request specific data at a defined point.
Webhooks A documented event initiates delivery to your system or connected tool. A real-time event payload defined by the webhook documentation. Your workflow should react to an event rather than wait for a separate retrieval step.
CLI Your process invokes the documented command-line workflow. Structured JSON provided through the CLI. Your existing operations process is organized around command-line execution.

For direct retrieval, verify the request and response contract before wiring the result into another system. For webhooks, verify the event, delivery payload, and receiving workflow. For the CLI, verify the command, inputs, output shape, and how your process handles a failed command. Each branch ends at the same boundary: use only the documented path and test the actual chain before implementation.

Webhook documentation

CLI documentation

Verify the Scribe API path before continuing

A verified integration begins with a narrow documented resource, a request assembled from its reference, and response handling that respects the status and body the endpoint defines. Apply the same checklist whether your prototype retrieves signature-related data, reacts to an event, or produces structured JSON through a command-line workflow.

Before you move beyond the prototype, confirm the endpoint, authentication, headers, parameters or body, response shape, status behavior, and documented errors. Run the complete multi-step journey and stop when an assumption fails. That sequence gives you a defensible decision about whether the selected Scribe workflow is ready for implementation.

Use the documented contract as the boundary for every field and behavior you add. If a required detail remains unresolved, keep it as an open implementation question until the relevant reference answers it.

Frequently asked questions about REST API and Scribe integrations

What is a REST API sample?

It is a worked example of an HTTP request and the server response it produces. The sample shows the method, URL, headers, parameters or body, status code, and response data so you can understand the contract before writing integration logic.

How do I adapt a generic REST API sample to Scribe?

Keep the request-response sequence, but replace every placeholder only with details confirmed in Scribe's API documentation. Select a documented resource, use the documented method and path under the /v1 API, add the required authentication and inputs, then map only the response fields and status outcomes the reference defines.

What should I verify before using a REST API sample in production?

Confirm that the endpoint exists, the method is correct, authentication and headers meet the documented requirements, query parameters and body fields have the expected names and types, and response statuses and body conditions are handled. Test the smallest documented request first, then validate the complete multi-step workflow.

How should a client handle a successful REST API response?

Check the status before parsing the body. A 200 OK response commonly includes data, a 201 Created response indicates that a resource was created, and a 204 No Content response succeeds without a response body. Handle only the statuses and response fields documented for the endpoint.

When should I use direct API retrieval, webhooks, or the CLI for signature data?

Use direct retrieval when your client needs to request documented data at a defined point. Use webhooks when a documented event should initiate delivery to your system or a connected tool. Use the CLI when your operations workflow is organized around a documented command that provides structured JSON. Verify the inputs and output contract for the selected path before connecting it to another system.

Which parts of a REST API sample are placeholders rather than confirmed Scribe behavior?

A generic URL, token, query parameter, body field, resource identifier, and response property are placeholders unless Scribe's documentation defines them. Confirmed details include Scribe's documented API base URL, /v1 versioning, and JSON over HTTPS; the target endpoint's exact authentication, fields, response schema, and status behavior still require endpoint-level verification.

Get started with Scribe

Let AI build your signature — from a screenshot

Free 14-day trial — no credit card.

Keep reading

AI, API & IntegrationsNov 27, 202619 min read

MCP Server Marketplace: How to Vet a Server

Learn how to find, compare, and validate MCP servers by checking listings, runtime behavior, access scope, cost, and workflow fit.

AI, API & IntegrationsNov 27, 202614 min read

Claude MCP Login: Connect Scribe with OAuth

Learn how Claude MCP login connects Scribe through OAuth, how to verify the official connector, and when to stop before authorizing.

AI, API & IntegrationsNov 27, 202620 min read

REST API Example: Read Scribe Analytics Safely

Learn how to read a REST API example, call documented Scribe analytics endpoints, validate responses, and handle webhook events.

Stripe email signature – Patrick Collison
Notion email signature – Camille Ricketts

Start your 14-day
free trial

Join 10,000+ companies using Scribe to power 15 million daily brand impressions

No card required. All features. Unlimited users.

Nike email signature – Greg Hoffman
Headspace email signature – Andy Puddicombe