Skip to content

Commit

Permalink
CMB-586: add booklets CRUD documentation (#498)
Browse files Browse the repository at this point in the history
* CMB-645: add list, get and delete endpoints for snap packs (#495)

* booklet create

* add code samples for create; start on get

* get and delete endpoints

* remove color; update campaign_id verbiage

* remove color from the response examples
  • Loading branch information
sachinmurali authored Jul 3, 2024
1 parent 0ea76b6 commit c02f78f
Show file tree
Hide file tree
Showing 23 changed files with 1,290 additions and 148 deletions.
419 changes: 279 additions & 140 deletions docs/index.html

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion lob-api-public.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.3

Check warning on line 1 in lob-api-public.yml

View workflow job for this annotation

GitHub Actions / Lint (push)

oas3-valid-media-example

This format violates OpenAPI 3.1 rules
info:
title: Lob
version: 1.19.35
version: 1.19.36
description: |
The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p>
license:
Expand Down Expand Up @@ -2347,6 +2347,7 @@ x-tagGroups:
- Letters
- Checks
- Snap Packs
- Booklets
- Bank Accounts
- Templates
- Template Versions
Expand Down Expand Up @@ -2434,6 +2435,10 @@ paths:
$ref: resources/billing_groups/billing_group.yml
/billing_groups:
$ref: resources/billing_groups/billing_groups.yml
/booklets/{booklet_id}:
$ref: resources/booklets/booklet.yml
/booklets:
$ref: resources/booklets/booklets.yml
/buckslips:
$ref: resources/buckslips/buckslips.yml
/buckslips/{buckslip_id}:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lob/openapi",
"version": "1.19.35",
"version": "1.19.36",
"engines": {
"node": ">=14.16.0",
"npm": ">=7.9.0"
Expand Down
21 changes: 21 additions & 0 deletions resources/booklets/attributes/booklet_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
description: >-
Notes:
- HTML merge variables should not include delimiting whitespace.
- All pages of a supplied PDF file must be sized per the `size` attribute,
while supplied HTML will be rendered and trimmed to as many `size` pages
as necessary.
- For design specifications, please see our
<a href="https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_template.pdf" target="_blank">PDF</a>
and [HTML](#section/HTML-Examples) templates.
See <a href="https://lob.com/pricing/print-mail#compare" target="_blank">pricing</a> for extra costs incurred.
oneOf:
- $ref: "../../../shared/attributes/html_string.yml"
- $ref: "../../../shared/attributes/model_ids/tmpl_id.yml"
- $ref: "../../../shared/attributes/remote_file_url.yml"
- type: string
pattern: "^(?!https://)[a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf)$"
5 changes: 5 additions & 0 deletions resources/booklets/attributes/booklet_id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: string

description: Unique identifier prefixed with `ord_`.

pattern: "^ord_[0-9a-f]{26}$"
10 changes: 10 additions & 0 deletions resources/booklets/attributes/booklet_size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: string

enum:
- 9x6
- 8.375x5.375

description: >
Specifies the size of the booklet.
default: 9x6
7 changes: 7 additions & 0 deletions resources/booklets/attributes/booklet_use_type.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: The use type for each mailpiece. Can be one of marketing, operational, or null. Null use_type is only allowed if an account default use_type is selected in Account Settings. For more information on use_type, see our [Help Center article](https://help.lob.com/print-and-mail/building-a-mail-strategy/managing-mail-settings/declaring-mail-use-type).
type: string
enum:
- marketing
- operational
- null
nullable: true
62 changes: 62 additions & 0 deletions resources/booklets/booklet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
parameters:
- in: path
name: booklet_id
description: id of the booklet
required: true
schema:
$ref: "attributes/booklet_id.yml"

get:
operationId: booklet_retrieve

summary: Retrieve

description: >-
Retrieves the details of an existing booklet. You need to only supply
the unique booklet identifier that was returned upon booklet creation.
tags:
- Booklets

Check warning on line 19 in resources/booklets/booklet.yml

View workflow job for this annotation

GitHub Actions / Lint (push)

operation-tag-defined

Operation tags must be defined in global tags.

responses:
"200":
description: Returns a booklet object
content:
$ref: responses/booklet.yml

default:
$ref: "../../shared/responses/mailpiece_error.yml"

x-codeSamples:
- lang: Shell
source: |
curl -X GET "https://api.lob.com/v1/booklets/ord_0d6a16a3fff6318ac8f8008dc1" \
-u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
label: CURL

delete:
operationId: booklet_delete

summary: Delete

description: >-
Completely removes a booklet from production. This can only be done if the booklet's
`send_date` has not yet passed. If the booklet is successfully canceled, you will not
be charged for it.
tags:
- Booklets

Check warning on line 48 in resources/booklets/booklet.yml

View workflow job for this annotation

GitHub Actions / Lint (push)

operation-tag-defined

Operation tags must be defined in global tags.

responses:
"200":
$ref: "../../shared/responses/booklet_deleted.yml"

default:
$ref: "../../shared/responses/mailpiece_error.yml"

x-codeSamples:
- lang: Shell
source: |
curl -X DELETE https://api.lob.com/v1/booklets/ord_0d6a16a3fff6318ac8f8008dc1 \
-u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
label: CURL
Loading

0 comments on commit c02f78f

Please sign in to comment.