Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMB-586: add booklets CRUD documentation #498

Merged
merged 6 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
booklet create
sachinmurali committed Jun 20, 2024
commit b7a1b819114394be3dea203ed147dbc2a3e9ac25
325 changes: 195 additions & 130 deletions docs/index.html

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lob-api-public.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.0.3

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

GitHub Actions / Lint (push)

oas3-valid-media-example

This format violates OpenAPI 3.1 rules
info:
title: Lob
version: 1.19.35
@@ -914,7 +914,7 @@
<div class="back-to-top" ><a href="#" onclick="toTopLink()">back to top</a></div>
- name: Getting Started
x-traitTag: true
description: |

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

GitHub Actions / Lint (push)

no-script-tags-in-markdown

Markdown descriptions must not have "<script>" tags.
### 1. Get Setup
* Create an account at <a href="https://dashboard.lob.com/#/register" target="_blank">Lob.com</a>
* Obtain your API keys in the Lob dashboard <a href="https://dashboard.lob.com/settings/api-keys" target="_blank">settings</a>
@@ -2347,6 +2347,7 @@
- Letters
- Checks
- Snap Packs
- Booklets
- Bank Accounts
- Templates
- Template Versions
@@ -2434,6 +2435,8 @@
$ref: resources/billing_groups/billing_group.yml
/billing_groups:
$ref: resources/billing_groups/billing_groups.yml
/booklets:
$ref: resources/booklets/booklets.yml
/buckslips:
$ref: resources/buckslips/buckslips.yml
/buckslips/{buckslip_id}:
14 changes: 0 additions & 14 deletions resources/booklets/attributes/booklet_file.yml
Original file line number Diff line number Diff line change
@@ -11,20 +11,6 @@ description: >-
<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.

- If a `custom_envelope` is used, follow
<a href="https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_custom_envelope.pdf" target="_blank">this template</a>.

- For domestic destinations, the file limit is 60 pages single-sided or 120
pages double-sided. For international destinations, the file limit is 6
pages single-sided or 12 pages double-sided. PDFs that surpass the file
limit will error, while HTML that renders more pages than the file limit
will be trimmed.

- Any booklets over 6
pages single-sided or 12 pages double-sided will be placed in a
<a href="https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_flat_template.pdf" target="_blank">flat envelope</a> instead of the standard double window envelope.


See <a href="https://lob.com/pricing/print-mail#compare" target="_blank">pricing</a> for extra costs incurred.

oneOf:
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}$"
4 changes: 4 additions & 0 deletions resources/booklets/attributes/color.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

color shouldn't be part of the booklet payload so we can remove this attribute and remove color from the samples. I think we still have it in the booklet serializer but currently it will always be undefined. I'll create a ticket to remove color and return_address.

description: >-
Booklets are always printed in color.
default: true
12 changes: 11 additions & 1 deletion resources/booklets/booklets.yml
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@
summary: Create

description: >-
Create a new booklet.
Creates a new booklet.

tags:
- Booklets

Check warning on line 10 in resources/booklets/booklets.yml

GitHub Actions / Lint (push)

operation-tag-defined

Operation tags must be defined in global tags.

parameters:
- $ref: "../../shared/parameters/idempotency.yml#/idem-header"
@@ -56,6 +56,7 @@
right: "2"
pages: "1-2,4-5"
fsc: true
size: "9x6"

application/x-www-form-urlencoded:
schema:
@@ -97,6 +98,7 @@
right: "2"
pages: "1-2,4-5"
fsc: true
size: "9x6"

multipart/form-data:
schema:
@@ -138,3 +140,11 @@
right: "2"
pages: "1-2,4-5"
fsc: true
size: "9x6"

responses:
"200":
$ref: responses/post_booklet.yml

default:
$ref: "../../shared/responses/mailpiece_error.yml"
29 changes: 29 additions & 0 deletions resources/booklets/models/booklet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
allOf:
- type: object

properties:
tracking_events:
description: An array of tracking events ordered by ascending `time`.
type: array
items:
$ref: "../../../shared/resources/tracking_events/models/tracking_event_normal.yml"

description:
$ref: "../../../shared/attributes/resource_description.yml"

metadata:
$ref: "../../../shared/models/metadata.yml"

merge_variables:
$ref: "../../../shared/models/merge_variables.yml"

send_date:
$ref: "../../../shared/attributes/send_date.yml"

mail_type:
$ref: "../../../shared/attributes/mail_type.yml"

color:
$ref: "../attributes/color.yml"

- $ref: "booklet_generated_base.yml"
2 changes: 1 addition & 1 deletion resources/booklets/models/booklet_editable.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ allOf:

- type: object

# color is not a required for booklets
# color is not a required property for booklets
required:
- to
- from
54 changes: 54 additions & 0 deletions resources/booklets/models/booklet_generated_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
allOf:
- $ref: "../../../shared/models/form_factor/generated.yml"
- $ref: "../../../shared/models/form_factor/from.yml"

- type: object

required:
- id
- from
- use_type

properties:
url:
$ref: "../../../shared/attributes/signed_link.yml"

id:
$ref: "../attributes/booklet_id.yml"

template_id:
allOf:
- description: The unique ID of the HTML template used for the booklet.
- $ref: "../../../shared/attributes/model_ids/tmpl_id.yml"

template_version_id:
allOf:
- description: The unique ID of the specific version of the HTML template used for the booklet.
type: string
- $ref: "../../../shared/attributes/model_ids/vrsn_id.yml"

campaign_id:
$ref: "../../../shared/attributes/campaign_id.yml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be updated to note that campaign ids for booklets will also be prefixed with camp_.
It also looks like the description in /shared/parameters/campaign_id.yml should also be updated for the list endpoint parameter.


use_type:
$ref: "../attributes/booklet_use_type.yml"

fsc: # Forest Stewardship Council
type: boolean
description: This is in beta. Contact support@lob.com or your account contact to learn more.
default: false

status:
$ref: "../../../shared/attributes/status.yml"

failure_reason:
allOf:
- $ref: "../../../shared/models/failure_reason/failure_reason.yml"
- nullable: true

object:
type: string
description: Value is resource type.
enum:
- booklet
default: booklet
63 changes: 63 additions & 0 deletions resources/booklets/responses/booklet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
application/json:
schema:
$ref: "../models/booklet.yml"
example:
id: ord_0d6a16a3fff6318ac8f8008dc1
description: April Campaign
metadata: {}
to:
id: adr_d3489cd64c791ab5
description: null
name: HARRY ZHANG
company: null
phone: null
email: null
address_line1: 210 KING ST STE 6100
address_line2: null
address_city: SAN FRANCISCO
address_state: CA
address_zip: 94107-1741
address_country: UNITED STATES
metadata: {}
date_created: "2017-09-05T15:54:53.264Z"
date_modified: "2017-09-05T15:54:53.264Z"
deleted: true
object: address
from:
id: adr_b8fb5acf3a2b55db
description: null
name: LEORE AVIDAR
company: null
phone: null
email: null
address_line1: 210 KING ST STE 6100
address_line2: null
address_city: SAN FRANCISCO
address_state: CA
address_zip: 94107-1741
address_country: UNITED STATES
metadata: {}
date_created: "2017-09-05T15:54:53.264Z"
date_modified: "2017-09-05T15:54:53.264Z"
deleted: true
object: address
color: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

mail_type: usps_first_class
url: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d.pdf?version=v1&expires=1618512040&signature=qvyCqXI1ndBvc4AjvG8FlirqLXEcfmYo4sDrRtabaXMOsX88to9G3K49uIk_aqevvZXe8HoRYD_nWydbQHqaCA
carrier: USPS
tracking_number: null
tracking_events: []
thumbnails:
- small: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_small_1.png?version=v1&expires=1618512040&signature=-bipeUHP-hAMcCBSrWM0ZH1VwRdSPNVGGZN9hAZKr6Lh4ly6uxvratVd5LXJCK_zOEMYk_mTWASt0ge7OY6SDA
medium: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_medium_1.png?version=v1&expires=1618512040&signature=ryxN7bsXGtw_GRFSP3Cs3A3IYjxZi3cW9BHDCNgMt6p3nobVmsc_iFHt2e-S7ndAXhhN7nP-MQVov3bt3r37BQ
large: https://lob-assets.com/order-creatives/ord_0d6a16a3fff6318ac8f8008dc1_comp_a20fd48ba4efda76ee827400d_thumb_large_1.png?version=v1&expires=1618512040&signature=kBrm00xkyCkJNJRHxH8HshFaebtOxnzjVWOs1VVmGMuw8H6OBNcMAMxt9s49K0jlpHoh3Nr9uSncEZMQaaNjAg
merge_variables:
name: Harry
size: 9x6
expected_delivery_date: "2021-03-24"
date_created: "2021-03-16T18:40:40.504Z"
date_modified: "2021-03-16T18:40:40.504Z"
send_date: "2021-03-16T18:45:40.493Z"
use_type: marketing
fsc: false
object: booklet
12 changes: 12 additions & 0 deletions resources/booklets/responses/post_booklet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Returns a booklet object

headers:
ratelimit-limit:
$ref: "../../../shared/headers/ratelimit.yml#/ratelimit-limit"
ratelimit-remaining:
$ref: "../../../shared/headers/ratelimit.yml#/ratelimit-remaining"
ratelimit-reset:
$ref: "../../../shared/headers/ratelimit.yml#/ratelimit-reset"

content:
$ref: "booklet.yml"
2 changes: 1 addition & 1 deletion shared/models/qr_code.yml
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ properties:

pages:
type: string
description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers and snap packs, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7").
description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers and snap packs, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters and booklets, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7").

logo:
type: object
2 changes: 1 addition & 1 deletion shared/models/qr_code_campaigns.yml
Original file line number Diff line number Diff line change
@@ -38,4 +38,4 @@ properties:

pages:
type: string
description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers and snap packs, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7").
description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers and snap packs, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters and booklets, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7").
Loading