From 0a45ea84e89a98fe18d811b3aa7a3b3da68994ed Mon Sep 17 00:00:00 2001 From: Michael Morgan <94082162+mmorgan-lob@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:23:18 -0800 Subject: [PATCH] DXP-1420 list params for campaign_id and status (#473) * DXP-1420 list params for campaign_id and status * DXP-1420 apply pattern for all references * DXP-1420 bump version --- dist/lob-api-bundled.yml | 89 ++- docs/index.html | 133 +++- lob-api-public.yml | 752 +++++++++++++++--- package-lock.json | 2 +- package.json | 2 +- resources/checks/checks.yml | 1 + resources/checks/models/check.yml | 6 +- resources/letters/letters.yml | 2 + .../letters/models/letter_generated_base.yml | 10 +- resources/postcards/models/postcard.yml | 10 +- resources/postcards/postcards.yml | 2 + resources/self_mailers/models/self_mailer.yml | 9 +- resources/self_mailers/self_mailers.yml | 2 + shared/attributes/campaign_id.yml | 5 + shared/attributes/status.yml | 12 + shared/parameters/campaign_id.yml | 9 + shared/parameters/status.yml | 10 + 17 files changed, 864 insertions(+), 192 deletions(-) create mode 100644 shared/attributes/campaign_id.yml create mode 100644 shared/attributes/status.yml create mode 100644 shared/parameters/campaign_id.yml create mode 100644 shared/parameters/status.yml diff --git a/dist/lob-api-bundled.yml b/dist/lob-api-bundled.yml index 5ab46299..cdb84f34 100644 --- a/dist/lob-api-bundled.yml +++ b/dist/lob-api-bundled.yml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: Lob - version: 1.19.22 + version: 1.19.23 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 @@ -6970,6 +6970,21 @@ components: anyOf: - format: date-time - format: date + status: + type: string + enum: + - processed + - rendered + - failed + description: > + A string describing the PDF render status: + + * `processed` - the rendering process is currently in progress. + + * `rendered` - a PDF has been successfully rendered of the mailpiece. + + * `failed` - one or more issues has caused the rendering process to + fail. merge_variables: type: object description: >- @@ -7440,11 +7455,7 @@ components: use_type: $ref: '#/components/schemas/chk_use_type' status: - title: The status of the check. - enum: - - processed - - rendered - - failed + $ref: '#/components/schemas/status' failure_reason: allOf: - $ref: '#/components/schemas/failure_reason' @@ -8500,6 +8511,14 @@ components: properties: from: $ref: '#/components/schemas/address' + campaign_id: + title: campaign_id + description: >- + Denotes resources created by the provided campaign id, prefixed with + `cmp_`. + type: string + pattern: ^cmp_[a-zA-Z0-9]+$ + nullable: true ltr_use_type: description: >- The use type for each mailpiece. Can be one of marketing, operational, @@ -8539,11 +8558,7 @@ components: type: string - $ref: '#/components/schemas/vrsn_id' campaign_id: - type: string - description: >- - The unique ID of the associated campaign if the resource was - generated from a campaign. - nullable: true + $ref: '#/components/schemas/campaign_id' use_type: $ref: '#/components/schemas/ltr_use_type' fsc: @@ -8553,11 +8568,7 @@ components: to learn more. Not available for `A4` letter size. default: false status: - title: The status of the letter. - enum: - - processed - - rendered - - failed + $ref: '#/components/schemas/status' failure_reason: allOf: - $ref: '#/components/schemas/failure_reason' @@ -9266,11 +9277,7 @@ components: url: $ref: '#/components/schemas/signed_link' campaign_id: - type: string - description: >- - The unique ID of the associated campaign if the resource was - generated from a campaign. - nullable: true + $ref: '#/components/schemas/campaign_id' use_type: $ref: '#/components/schemas/psc_use_type' fsc: @@ -9280,11 +9287,7 @@ components: to learn more. Not available for `4x6` or `A5` postcard sizes. default: false status: - title: The status of the postcard. - enum: - - processed - - rendered - - failed + $ref: '#/components/schemas/status' failure_reason: allOf: - $ref: '#/components/schemas/failure_reason' @@ -9615,11 +9618,9 @@ components: to learn more. Not available for `11x9_bifold` self-mailer size. default: false status: - title: The status of the self mailer. - enum: - - processed - - rendered - - failed + $ref: '#/components/schemas/status' + campaign_id: + $ref: '#/components/schemas/campaign_id' failure_reason: allOf: - $ref: '#/components/schemas/failure_reason' @@ -10574,6 +10575,16 @@ components: - date_created - required: - send_date + status: + in: query + name: status + description: | + A string describing the render status: + * `processed` - the rendering process is currently underway. + * `rendered` - the rendering process has completed successfully. + * `failed` - the rendering process has failed. + schema: + $ref: '#/components/schemas/status' idem-header: in: header name: Idempotency-Key @@ -10600,6 +10611,15 @@ components: type: string maxLength: 256 example: 026e7634-24d7-486c-a0bb-4a17fd0eebc5 + campaign_id: + in: query + name: campaign_id + required: false + description: >- + Filters resources created by the provided campaign id, prefixed with + `cmp_`. + schema: + $ref: '#/components/schemas/campaign_id' responses: address_error: description: Error @@ -17693,6 +17713,7 @@ paths: - $ref: '#/components/parameters/send_date' - $ref: '#/components/parameters/mail_type' - $ref: '#/components/parameters/sort_by' + - $ref: '#/components/parameters/status' responses: '200': $ref: '#/components/responses/all_checks' @@ -19740,6 +19761,8 @@ paths: - $ref: '#/components/parameters/include' - $ref: '#/components/parameters/date_created' - $ref: '#/components/parameters/metadata' + - $ref: '#/components/parameters/campaign_id' + - $ref: '#/components/parameters/status' - in: query name: color description: >- @@ -20861,6 +20884,8 @@ paths: - $ref: '#/components/parameters/include' - $ref: '#/components/parameters/date_created' - $ref: '#/components/parameters/metadata' + - $ref: '#/components/parameters/campaign_id' + - $ref: '#/components/parameters/status' - in: query name: size description: >- @@ -22884,6 +22909,8 @@ paths: - $ref: '#/components/parameters/send_date' - $ref: '#/components/parameters/mail_type' - $ref: '#/components/parameters/sort_by' + - $ref: '#/components/parameters/campaign_id' + - $ref: '#/components/parameters/status' responses: '200': $ref: '#/components/responses/all_self_mailers' diff --git a/docs/index.html b/docs/index.html index daac5aab..f9a26dab 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2965,7 +2965,7 @@ 55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864 -231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688, -104.0616 -231.873,-231.248 z - " fill="currentColor">

Lob (1.19.22)

Lob Developer Experience: lob-openapi@lob.com URL: https://support.lob.com/ License: MIT Terms of Service

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.

+ " fill="currentColor">

Lob (1.19.23)

Lob Developer Experience: lob-openapi@lob.com URL: https://support.lob.com/ License: MIT Terms of Service

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.

Introduction

Lob’s Print & Mail and Address Verification APIs help companies transform outdated, manual print-and-mail processes; save 1,000s of hours in processing time by sending mail much more quickly; and increase ROI on offline communications.

@@ -3224,10 +3224,16 @@

3. Learn more

address obj with `name` defined (object) or address obj with `company` defined (object) (address_us)
front_template_version_id
string or null^vrsn_[a-zA-Z0-9]+$

The unique ID of the specific version of the HTML template used for the front of the postcard. Only filled out when the request contains a valid postcard template ID.

back_template_version_id
string or null^vrsn_[a-zA-Z0-9]+$

The unique ID of the specific version of the HTML template used for the back of the postcard. Only filled out when the request contains a valid postcard template ID.

Array of objects or null (tracking_event_normal)

An array of tracking_event objects ordered by ascending time. Will not be populated for postcards created in test mode.

-
campaign_id
string or null

The unique ID of the associated campaign if the resource was generated from a campaign.

+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Denotes resources created by the provided campaign id, prefixed with cmp_.

use_type
string or null (psc_use_type)
Enum: "marketing" "operational" null

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.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 4x6 or A5 postcard sizes.

-
status
any (The status of the postcard.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 4x6 or A5 postcard sizes.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
object or null

An object describing the reason for failure if the resource failed to render.

object
string
Default: "postcard"
Value: "postcard"

Value is resource type.

include
Array of strings

Request that the response include the total count by specifying include=["total_count"].

object (date_filter)

Filter by date created. Accepted formats are ISO-8601 date or datetime, e.g. { "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" } where gt is >, lt is <, gte is ≥, and lte is ≤.

object (metadata) <= 500 characters [^"\\]{0,500}

Filter by metadata key-value pair`.

+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Filters resources created by the provided campaign id, prefixed with cmp_.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the render status:

+
    +
  • processed - the rendering process is currently underway.
  • +
  • rendered - the rendering process has completed successfully.
  • +
  • failed - the rendering process has failed.
  • +
size
Array of strings (postcard_size)
Items Enum: "4x6" "6x9" "6x11"

Specifies the size of the postcard. Only 4x6 postcards can be sent to international destinations.

scheduled
boolean
  • true - only return orders (past or future) where send_date is @@ -3308,7 +3321,7 @@

    3. Learn more

adr_id (string) or (address_editable_us (address obj with `name` defined (object) or address obj with `company` defined (object)))

Required if to address is international. Must either be an address ID or an inline object with correct address parameters. Must either be an address ID or an inline object with correct address parameters. All addresses will be standardized into uppercase without being modified by verification.

billing_group_id
string (billing_group_id)

An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See Billing Group API for more information.

object (qr_code)

Customize and place a QR code on the creative at the required position.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 4x6 or A5 postcard sizes.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 4x6 or A5 postcard sizes.

Responses

Response Headers
ratelimit-limit
integer
Example: 150

The rate limit for a given endpoint.

ratelimit-remaining
integer
Example: 100

The number of requests remaining in the current window.

@@ -3336,10 +3349,16 @@

3. Learn more

address obj with `name` defined (object) or address obj with `company` defined (object) (address_us)
front_template_version_id
string or null^vrsn_[a-zA-Z0-9]+$

The unique ID of the specific version of the HTML template used for the front of the postcard. Only filled out when the request contains a valid postcard template ID.

back_template_version_id
string or null^vrsn_[a-zA-Z0-9]+$

The unique ID of the specific version of the HTML template used for the back of the postcard. Only filled out when the request contains a valid postcard template ID.

Array of objects or null (tracking_event_normal)

An array of tracking_event objects ordered by ascending time. Will not be populated for postcards created in test mode.

-
campaign_id
string or null

The unique ID of the associated campaign if the resource was generated from a campaign.

+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Denotes resources created by the provided campaign id, prefixed with cmp_.

use_type
string or null (psc_use_type)
Enum: "marketing" "operational" null

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.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 4x6 or A5 postcard sizes.

-
status
any (The status of the postcard.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 4x6 or A5 postcard sizes.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
object or null

An object describing the reason for failure if the resource failed to render.

object
string
Default: "postcard"
Value: "postcard"

Value is resource type.

merge_variables
object or null (merge_variables) <= 25000 characters

You can input a merge variable payload object to your template to render dynamic content. For example, if you have a template like: {{variable_name}}, pass in {"variable_name": "Harry"} to render Harry. merge_variables must be an object. Any type of value is accepted as long as the object is valid JSON; you can use strings, numbers, booleans, arrays, objects, or null. The max length of the object is 25,000 characters. If you call JSON.stringify on your object, it can be no longer than 25,000 characters. Your variable names cannot contain any whitespace or any of the following special characters: !, ", #, %, &, ', (, ), *, +, ,, /, ;, <, =, >, @, [, \, ], ^, `, {, |, }, ~. More instructions can be found in our guide to using html and merge variables. Depending on your Merge Variable strictness setting, if you define variables in your HTML but do not pass them here, you will either receive an error or the variable will render as an empty string.

string or string (send_date)

A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Setting a send date overrides the default cancellation window applied to the mailpiece. Until the send_date has passed, the mailpiece can be canceled. If a date in the format 2017-11-01 is passed, it will evaluate to midnight UTC of that date (2017-11-01T00:00:00.000Z). If a datetime is passed, that exact time will be used. A send_date passed with no time zone will default to UTC, while a send_date passed with a time zone will be converted to UTC.

-
size
string (self_mailer_size)
Default: "6x18_bifold"
Enum: "6x18_bifold" "11x9_bifold" "12x9_bifold" "17.75x9_trifold"

Specifies the size of the self mailer. The 17.75x9_trifold size is in beta. Contact support@lob.com or your account contact to learn more.

+
size
string (self_mailer_size)
Default: "6x18_bifold"
Enum: "6x18_bifold" "11x9_bifold" "12x9_bifold" "17.75x9_trifold"

Specifies the size of the self mailer. The 17.75x9_trifold size is in beta. Contact support@lob.com or your account contact to learn more.

Array of objects (thumbnail)
expected_delivery_date
string <date> (expected_delivery_date)

A date in YYYY-MM-DD format of the mailpiece's expected delivery date based on its send_date.

date_created
string <date-time> (date_created)

A timestamp in ISO 8601 format of the date the resource was created.

date_modified
string <date-time> (date_modified)

A timestamp in ISO 8601 format of the date the resource was last modified.

@@ -3374,8 +3393,15 @@

3. Learn more

inside_template_version_id
string or null^vrsn_[a-zA-Z0-9]+$

Unique identifier prefixed with vrsn_.

object
string
Default: "self_mailer"
Value: "self_mailer"

Value is resource type.

Array of objects (tracking_event_certified)

An array of certified tracking events ordered by ascending time. Not populated in test mode.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 11x9_bifold self-mailer size.

-
status
any (The status of the self mailer.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 11x9_bifold self-mailer size.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Denotes resources created by the provided campaign id, prefixed with cmp_.

+
object or null

An object describing the reason for failure if the resource failed to render.

Request samples

curl -X GET "https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf" \
@@ -3403,7 +3429,14 @@ 

3. Learn more

string or string (send_date)

Filter by ISO-8601 date or datetime, e.g. { "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" } where gt is >, lt is <, gte is ≥, and lte is ≤.

mail_type
string (mail_type)
Default: "usps_first_class"
Enum: "usps_first_class" "usps_standard"

A string designating the mail postage type: * usps_first_class - (default) * usps_standard - a cheaper option which is less predictable and takes longer to deliver. usps_standard cannot be used with 4x6 postcards or for any postcards sent outside of the United States.

-
object or object

Sorts items by ascending or descending dates. Use either date_created or send_date, not both.

+
object or object

Sorts items by ascending or descending dates. Use either date_created or send_date, not both.

+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Filters resources created by the provided campaign id, prefixed with cmp_.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the render status:

+
    +
  • processed - the rendering process is currently underway.
  • +
  • rendered - the rendering process has completed successfully.
  • +
  • failed - the rendering process has failed.
  • +

Responses

Response Schema: application/json
object
string (object)

Value is resource type.

next_url
string or null

Url of next page of items in list.

@@ -3451,11 +3484,11 @@

3. Learn more

merge_variables
object or null (merge_variables) <= 25000 characters

You can input a merge variable payload object to your template to render dynamic content. For example, if you have a template like: {{variable_name}}, pass in {"variable_name": "Harry"} to render Harry. merge_variables must be an object. Any type of value is accepted as long as the object is valid JSON; you can use strings, numbers, booleans, arrays, objects, or null. The max length of the object is 25,000 characters. If you call JSON.stringify on your object, it can be no longer than 25,000 characters. Your variable names cannot contain any whitespace or any of the following special characters: !, ", #, %, &, ', (, ), *, +, ,, /, ;, <, =, >, @, [, \, ], ^, `, {, |, }, ~. More instructions can be found in our guide to using html and merge variables. Depending on your Merge Variable strictness setting, if you define variables in your HTML but do not pass them here, you will either receive an error or the variable will render as an empty string.

string or string (send_date)

A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Setting a send date overrides the default cancellation window applied to the mailpiece. Until the send_date has passed, the mailpiece can be canceled. If a date in the format 2017-11-01 is passed, it will evaluate to midnight UTC of that date (2017-11-01T00:00:00.000Z). If a datetime is passed, that exact time will be used. A send_date passed with no time zone will default to UTC, while a send_date passed with a time zone will be converted to UTC.

-
size
string (self_mailer_size)
Default: "6x18_bifold"
Enum: "6x18_bifold" "11x9_bifold" "12x9_bifold" "17.75x9_trifold"

Specifies the size of the self mailer. The 17.75x9_trifold size is in beta. Contact support@lob.com or your account contact to learn more.

+
size
string (self_mailer_size)
Default: "6x18_bifold"
Enum: "6x18_bifold" "11x9_bifold" "12x9_bifold" "17.75x9_trifold"

Specifies the size of the self mailer. The 17.75x9_trifold size is in beta. Contact support@lob.com or your account contact to learn more.

adr_id (string) or (address_editable_us (address obj with `name` defined (object) or address obj with `company` defined (object)))

Required if to address is international. Must either be an address ID or an inline object with correct address parameters. Must either be an address ID or an inline object with correct address parameters. All addresses will be standardized into uppercase without being modified by verification.

billing_group_id
string (billing_group_id)

An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See Billing Group API for more information.

object (qr_code)

Customize and place a QR code on the creative at the required position.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 11x9_bifold self-mailer size.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 11x9_bifold self-mailer size.

Responses

Response Headers
ratelimit-limit
integer
Example: 150

The rate limit for a given endpoint.

ratelimit-remaining
integer
Example: 100

The number of requests remaining in the current window.

@@ -3474,7 +3507,7 @@

3. Learn more

merge_variables
object or null (merge_variables) <= 25000 characters

You can input a merge variable payload object to your template to render dynamic content. For example, if you have a template like: {{variable_name}}, pass in {"variable_name": "Harry"} to render Harry. merge_variables must be an object. Any type of value is accepted as long as the object is valid JSON; you can use strings, numbers, booleans, arrays, objects, or null. The max length of the object is 25,000 characters. If you call JSON.stringify on your object, it can be no longer than 25,000 characters. Your variable names cannot contain any whitespace or any of the following special characters: !, ", #, %, &, ', (, ), *, +, ,, /, ;, <, =, >, @, [, \, ], ^, `, {, |, }, ~. More instructions can be found in our guide to using html and merge variables. Depending on your Merge Variable strictness setting, if you define variables in your HTML but do not pass them here, you will either receive an error or the variable will render as an empty string.

string or string (send_date)

A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Setting a send date overrides the default cancellation window applied to the mailpiece. Until the send_date has passed, the mailpiece can be canceled. If a date in the format 2017-11-01 is passed, it will evaluate to midnight UTC of that date (2017-11-01T00:00:00.000Z). If a datetime is passed, that exact time will be used. A send_date passed with no time zone will default to UTC, while a send_date passed with a time zone will be converted to UTC.

-
size
string (self_mailer_size)
Default: "6x18_bifold"
Enum: "6x18_bifold" "11x9_bifold" "12x9_bifold" "17.75x9_trifold"

Specifies the size of the self mailer. The 17.75x9_trifold size is in beta. Contact support@lob.com or your account contact to learn more.

+
size
string (self_mailer_size)
Default: "6x18_bifold"
Enum: "6x18_bifold" "11x9_bifold" "12x9_bifold" "17.75x9_trifold"

Specifies the size of the self mailer. The 17.75x9_trifold size is in beta. Contact support@lob.com or your account contact to learn more.

Array of objects (thumbnail)
expected_delivery_date
string <date> (expected_delivery_date)

A date in YYYY-MM-DD format of the mailpiece's expected delivery date based on its send_date.

date_created
string <date-time> (date_created)

A timestamp in ISO 8601 format of the date the resource was created.

date_modified
string <date-time> (date_modified)

A timestamp in ISO 8601 format of the date the resource was last modified.

@@ -3485,8 +3518,15 @@

3. Learn more

inside_template_version_id
string or null^vrsn_[a-zA-Z0-9]+$

Unique identifier prefixed with vrsn_.

object
string
Default: "self_mailer"
Value: "self_mailer"

Value is resource type.

Array of objects (tracking_event_certified)

An array of certified tracking events ordered by ascending time. Not populated in test mode.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 11x9_bifold self-mailer size.

-
status
any (The status of the self mailer.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for 11x9_bifold self-mailer size.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Denotes resources created by the provided campaign id, prefixed with cmp_.

+
object or null

An object describing the reason for failure if the resource failed to render.

Request samples

Content type
{
  • "description": "Demo Self Mailer job",
  • "to": "adr_bae820679f3f536b",
  • "from": "adr_210a8d4b0b76d77b",
  • "size": "12x9_bifold",
  • "metadata": {
    • "spiffy": "true"
    },
  • "mail_type": "usps_standard",
  • "merge_variables": {
    • "name": "Harry"
    },
  • "send_date": "2017-11-01T00:00:00.000Z",
  • "use_type": "marketing",
  • "qr_code": {
    • "position": "relative",
    • "redirect_url": "https://www.lob.com",
    • "width": "2.5",
    • "top": "2.5",
    • "right": "2.5",
    • "pages": "inside,outside"
    },
  • "fsc": true
}

Response samples

Content type
application/json
{}

Letters

The letters endpoint allows you to easily print and mail letters. The API provides endpoints for @@ -3531,9 +3571,15 @@

3. Learn more

url
string (signed_link) ^https://lob-assets.com/(letters|postcards|ba...

A signed link served over HTTPS. The link returned will expire in 30 days to prevent mis-sharing. Each time a GET request is initiated, a new signed URL will be generated.

template_id
string^tmpl_[a-zA-Z0-9]+$

Unique identifier prefixed with tmpl_. ID of a saved HTML template.

template_version_id
string^vrsn_[a-zA-Z0-9]+$

Unique identifier prefixed with vrsn_.

-
campaign_id
string or null

The unique ID of the associated campaign if the resource was generated from a campaign.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for A4 letter size.

-
status
any (The status of the letter.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Denotes resources created by the provided campaign id, prefixed with cmp_.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for A4 letter size.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
object or null

An object describing the reason for failure if the resource failed to render.

object
string
Default: "letter"
Value: "letter"

Value is resource type.

include
Array of strings

Request that the response include the total count by specifying include=["total_count"].

object (date_filter)

Filter by date created. Accepted formats are ISO-8601 date or datetime, e.g. { "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" } where gt is >, lt is <, gte is ≥, and lte is ≤.

object (metadata) <= 500 characters [^"\\]{0,500}

Filter by metadata key-value pair`.

+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Filters resources created by the provided campaign id, prefixed with cmp_.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the render status:

+
    +
  • processed - the rendering process is currently underway.
  • +
  • rendered - the rendering process has completed successfully.
  • +
  • failed - the rendering process has failed.
  • +
color
boolean

Set to true to return only color letters. Set to false to return only black & white letters.

scheduled
boolean
  • true - only return orders (past or future) where send_date is @@ -3624,7 +3677,7 @@

    3. Learn more

custom_envelope
string or null (user_provided) ^env_[a-zA-Z0-9]+$

Accepts an envelope ID for any customized envelope with available inventory. If no inventory is available for the specified ID, the letter will not be sent, and an error will be returned. If the letter has more than 6 sheets, it will be sent in a blank flat envelope. Custom envelopes may be created and ordered from the dashboard. This feature is exclusive to certain customers. Upgrade to the appropriate Print & Mail Edition to gain access.

billing_group_id
string (billing_group_id)

An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See Billing Group API for more information.

object (qr_code)

Customize and place a QR code on the creative at the required position.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for A4 letter size.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for A4 letter size.

Responses

Response Headers
ratelimit-limit
integer
Example: 150

The rate limit for a given endpoint.

ratelimit-remaining
integer
Example: 100

The number of requests remaining in the current window.

@@ -3665,9 +3718,15 @@

3. Learn more

url
string (signed_link) ^https://lob-assets.com/(letters|postcards|ba...

A signed link served over HTTPS. The link returned will expire in 30 days to prevent mis-sharing. Each time a GET request is initiated, a new signed URL will be generated.

template_id
string^tmpl_[a-zA-Z0-9]+$

Unique identifier prefixed with tmpl_. ID of a saved HTML template.

template_version_id
string^vrsn_[a-zA-Z0-9]+$

Unique identifier prefixed with vrsn_.

-
campaign_id
string or null

The unique ID of the associated campaign if the resource was generated from a campaign.

-
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for A4 letter size.

-
status
any (The status of the letter.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
campaign_id
string or null (campaign_id) ^cmp_[a-zA-Z0-9]+$

Denotes resources created by the provided campaign id, prefixed with cmp_.

+
fsc
boolean
Default: false

This is in beta. Contact support@lob.com or your account contact to learn more. Not available for A4 letter size.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
object or null

An object describing the reason for failure if the resource failed to render.

object
string
Default: "letter"
Value: "letter"

Value is resource type.

string or string (send_date)

Filter by ISO-8601 date or datetime, e.g. { "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" } where gt is >, lt is <, gte is ≥, and lte is ≤.

mail_type
string (mail_type)
Default: "usps_first_class"
Enum: "usps_first_class" "usps_standard"

A string designating the mail postage type: * usps_first_class - (default) * usps_standard - a cheaper option which is less predictable and takes longer to deliver. usps_standard cannot be used with 4x6 postcards or for any postcards sent outside of the United States.

-
object or object

Sorts items by ascending or descending dates. Use either date_created or send_date, not both.

+
object or object

Sorts items by ascending or descending dates. Use either date_created or send_date, not both.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the render status:

+
    +
  • processed - the rendering process is currently underway.
  • +
  • rendered - the rendering process has completed successfully.
  • +
  • failed - the rendering process has failed.
  • +

Responses

Response Schema: application/json
object
string (object)

Value is resource type.

next_url
string or null

Url of next page of items in list.

@@ -3776,7 +3841,13 @@

3. Learn more

attachment_template_version_id
string^vrsn_[a-zA-Z0-9]+$

Unique identifier prefixed with vrsn_.

Array of objects (thumbnail)
expected_delivery_date
string <date> (expected_delivery_date)

A date in YYYY-MM-DD format of the mailpiece's expected delivery date based on its send_date.

Array of objects or null (tracking_event_normal)

An array of tracking_event objects ordered by ascending time. Will not be populated for checks created in test mode.

-
status
any (The status of the check.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
object or null

An object describing the reason for failure if the resource failed to render.

object
string
Default: "check"
Value: "check"

Value is resource type.

deleted
boolean (deleted)

Only returned if the resource has been successfully deleted.

attachment_template_version_id
string^vrsn_[a-zA-Z0-9]+$

Unique identifier prefixed with vrsn_.

Array of objects (thumbnail)
expected_delivery_date
string <date> (expected_delivery_date)

A date in YYYY-MM-DD format of the mailpiece's expected delivery date based on its send_date.

Array of objects or null (tracking_event_normal)

An array of tracking_event objects ordered by ascending time. Will not be populated for checks created in test mode.

-
status
any (The status of the check.)
Enum: "processed" "rendered" "failed"
object or null

An object describing the reason for failure if the resource failed to render.

+
status
string (status)
Enum: "processed" "rendered" "failed"

A string describing the PDF render status:

+
    +
  • processed - the rendering process is currently in progress.
  • +
  • rendered - a PDF has been successfully rendered of the mailpiece.
  • +
  • failed - one or more issues has caused the rendering process to fail.
  • +
+
object or null

An object describing the reason for failure if the resource failed to render.

object
string
Default: "check"
Value: "check"

Value is resource type.

deleted
boolean (deleted)

Only returned if the resource has been successfully deleted.

+ * Launch your terminal and copy/paste a CURL command. + ```bash + curl https://api.lob.com/v1/addresses \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: ``` + * Download a [Lob SDK](#tag/SDKs-and-Tools) into your favorite IDE (integrated development environment) + ### 3. Learn more + Try our quick start (TypeScript, Python, PHP, Java or Ruby): + * Send your first Postcards + Use Case guides + * Mass Deletion Setup + * NCOA Restrictions + * Override Cancellation Window + * Visibility of Address Changes + * Ingesting Tracking Events with Webhooks +
back to top
- name: Identity Validation - description: | + description: > Validates whether a given name is associated with an address. +
back to top
- name: Intl Autocompletions - description: | - Address autocompletion for non-US addresses. Given partial address information, this endpoint returns up to 10 address suggestions. + description: > + Address autocompletion for non-US addresses. Given partial address + information, this endpoint returns up to 10 address suggestions. + ## Autocompletion Test Env + Your test API key does not autocomplete international addresses and is used to simulate + behavior. With your test API key, requests with specific values for `address_prefix` + return predetermined values. When `address_prefix` is set to: + - `0 suggestions` - Returns no suggestions + - `[PRIMARY NUMBER] s[uggestion]` - Returns a maximum of ten predefined suggested addresses. `[PRIMARY NUMBER]` does not have to be a valid primary number when sending a test request. Each additional letter in `suggestion` reduces the number of suggestions by one (e.g. `1 su` returns 9 suggested addresses). `[PRIMARY NUMBER]` does not affect the number of suggestions returned. Country is a required field. + City and state filters work as expected and filter the list of predetermined suggested addresses. + See the `test` request & response examples under [Autocomplete Examples](#operation/intl_autocompletions) within the "Autocomplete + a partial address" section in Intl Autocompletions. +
back to top
- name: Intl Verifications - description: | + description: > Address verification for non-US addresses +
+
back to top
+ ## Intl Verifications Test Env + When verifying international addresses, you'll likely want to test against + a wide array of addresses to ensure you're handling responses correctly. + With your test API key, requests that use specific values for `primary_line` + let you explore the responses to many types of addresses: + @@ -1014,83 +1152,137 @@ tags:
DELIVERABILITY OF SAMPLE RESPONSE
+ See the `test` request & response examples under [Intl Verification Examples](#operation/intl_verification) within the + "Verify an international address section" in Intl Verifications. + You can rely on the response from these examples generally matching the response + you'd see in the live environment with an address of that type (excluding the `recipient` field). + The test API key does not perform any verification, automatic correction, or standardization + for addresses. If you wish to try these features out, use our live demo + or the free plan (see our pricing for details). +
back to top
- name: Introduction x-traitTag: true - description: | - Lob’s Print & Mail and Address Verification APIs help companies transform outdated, + description: > + Lob’s Print & Mail and Address Verification APIs help companies transform + outdated, + manual print-and-mail processes; save 1,000s of hours in processing time by sending mail much more + quickly; and increase ROI on offline communications. + Automate direct mail by triggering on-demand postcards, letters, and checks directly from your + CRM or customer data systems. + Address Verification corrects, standardizes, and cleanses address data for assured delivery with + instant verification across 240+ countries and territories. + Lob's print delivery network eliminates the hassle of vendor management with automated + production and postage across a global network of vetted commercial printers. + Tracking & Analytics gives you complete visibility of production and delivery for each piece of + mail you send to meet compliance requirements and measure campaign performance. - name: Letters - description: | - The letters endpoint allows you to easily print and mail letters. The API provides endpoints for + description: > + The letters endpoint allows you to easily print and mail letters. The API + provides endpoints for + creating letters, retrieving individual letters, canceling letters, and retrieving a list of letters. +
back to top
- name: Manage Mail x-traitTag: true - description: | + description: > ## Cancellation Windows + By default, all new accounts have a 5 minute cancellation window for postcards, + self mailers, letters, and checks. Within that timeframe, you can cancel + mailings from production, free of charge. Once the window has passed for a + postcard, self mailer, letter, or check, the mailing is no longer cancelable. + In addition, certain customers can customize their cancellation windows by + product in their Dashboard Settings. Upgrade to + the appropriate Print & Mail Edition + to automatically gain access to this ability. For more details on this feature, + check out our Cancellation Guide. + If you schedule a postcard, self mailer, letter, or check for up to 180 days + in the future by supplying the `send_date` parameter, that will override any + cancellation window you may have for that product. +
+
back to top
+ ## Scheduled Mailings + Postcards, self mailers, letters, and checks can be scheduled to be sent up + to 180 days in advance. You can use this feature to: + - Create automated drip campaigns (e.g. send a postcard at 15, 30, and 60 + days) + - Schedule recurring sends + - Plan your mailing schedule ahead of time + Up until the time a mailing is scheduled for, it can also be canceled. + If you use this feature in conjunction with [a cancellation window]( + index.html#section/Cancellation-Windows), the `send_date` parameter will always + take precedence. + For implementation details, see documentation below for each respective + endpoint. For more help, see our Scheduled Mailings Guide. + This feature is exclusive to certain customers. Upgrade to the appropriate + Print & Mail Edition to + gain access. + ### Example Create Request using Send Date + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1102,87 +1294,143 @@ tags: -d "merge_variables[name]=Harry" \ -d "send_date=2021-07-26" ``` +
back to top
- name: National Change of Address x-traitTag: true - description: | - National Change of Address Linkage (NCOALink) is a service offered by the USPS, which allows individuals + description: > + National Change of Address Linkage (NCOALink) is a service offered by the + USPS, which allows individuals + or businesses who have recently moved to have any mail forwarded from their previous address + to their new address. + As a CASS-certified Address Verification Provider, Lob also offers NCOALink + functionality to our Print & Mail customers. With the Lob NCOALink feature enabled, Postcards, + Letters, Checks and Addresses can automatically be corrected to reflect an individual's or business's + new address in the case that they have moved (only if they have registered for NCOALink with the USPS). + Due to privacy concerns and USPS constraints, for customers with NCOALink enabled, our API responses + for a limited set of endpoints differ slightly in the case when an address has been changed through NCOALink. + **NOTE**: This feature is exclusive to certain customers. Upgrade to the appropriate Print & Mail Editions to gain access. + For more information, see our NCOALink guide. +
+
back to top
+ ## NCOALink Live Environment + Though there are no changes to API requests, there are significant changes to our API responses, but + only in the event that an address has been changed through NCOALink. If an address has not been changed + through NCOALink, the response would be identical to our standard responses, except the addition of a + `recipient_moved` field, which is `false` for unchanged addresses. + If an address has been changed through NCOALink, we are required to suppress the following response + fields for that address: + - `address_line1` + - `address_line2` + - The +4 portion of the ZIP+4 (5-digit ZIP code will still be present) + See the `ncoa_us_live` example under [Response samples](#operation/address_create) within the "Create an Address" section in Addresses +
+
back to top
+ ## NCOALink Test Environment + In addition to sending live requests, you may also want to simulate what an NCOALink response might + look like so that you can ensure your application behaves as expected. The behavior of NCOALink in + Lob's Test Environment is very similar to our [US Verifications Test Mode](#section/US-Verifications-Test-Env). + To simulate an NCOALink request, send a POST request to any of the four endpoints below with an `address_line1` field equal to `NCOA`: + - `POST /v1/addresses` + - `POST /v1/checks` + - `POST /v1/letters` + - `POST /v1/postcards` + - `POST /v1/self_mailers` + A static address will always be returned, as documented in the `ncoa_us_test` example under [Response samples](#operation/address_create) within the "Create an Address" + section in Addresses (along with the corresponding request under "Request samples"). +
back to top
- name: Postcards - description: | - The postcards endpoint allows you to easily print and mail postcards. The API provides endpoints for creating postcards, + description: > + The postcards endpoint allows you to easily print and mail postcards. The + API provides endpoints for creating postcards, + retrieving individual postcards, canceling postcards, and retrieving a list of postcards. +
back to top
- name: QR Codes - description: | + description: > Lob QR codes allow you to generate a QR code that is unique to each mailpiece, thereby allowing each and every customers to receive a personalized link. See the Create endpoint for Letters, Postcards or Self Mailers to learn how to embed a QR code into your mail piece. + Webhooks can be used to integrate Lob QR code scans into your omni channel marketing strategy. See the Webhooks section of our documentation to learn how to enable the `letter.viewed`, `postcard.viewed` and `self_mailer.viewed` event notifications for your mail pieces. + Furthermore, our QR code Analytics endpoint can be used to track the impact and engagement rate of your mail sends. Lob can tell you exactly which recipients opened your mailpiece. Our Analytics endpoint allows you to see exactly which recipient scanned a mailpiece, when they scanned it, and more! +
back to top
- name: Rate Limiting x-traitTag: true - description: |- - To prevent misuse, we enforce a rate limit on an API Key and endpoint basis, similar to the way many other APIs enforce rate limits. By default, all accounts and their corresponding Test and Live API Keys have a rate limit of 150 requests per 5 seconds per endpoint. The `POST /v1/us_verifications` and `POST /v1/us_autocompletions` endpoints have a limit of 300 requests per 5 seconds for all accounts. + description: >- + To prevent misuse, we enforce a rate limit on an API Key and endpoint + basis, similar to the way many other APIs enforce rate limits. By default, + all accounts and their corresponding Test and Live API Keys have a rate + limit of 150 requests per 5 seconds per endpoint. The `POST + /v1/us_verifications` and `POST /v1/us_autocompletions` endpoints have a + limit of 300 requests per 5 seconds for all accounts. + When your application exceeds the rate limit for a given API endpoint, the Lob API will return an HTTP 429 "Too Many Requests" response code instead of the variety of codes you would find across the other API endpoints. + **HTTP Headers** + HTTP headers are returned on each request to a rate limited endpoint. Ensure that you inspect these headers during your requests as they provide relevant data on how many more requests your application is allowed to make for the endpoint you just utilized. + While the headers are documented here in titlecase, HTTP headers are case insensitive and certain libraries may transform them to lowercase. Please inspect your headers carefully to see how they will be represented in your chosen development scenario. + @@ -1201,18 +1449,23 @@ tags:
+ ### Example HTTP Headers + ```bash X-Rate-Limit-Limit:150 X-Rate-Limit-Remaining:100 X-Rate-Limit-Reset:1528749846 ``` + ### Example Response + If you hit the rate limit on a given endpoint, this is the body of the HTTP 429 message that you will see: + ```javascript { "error": { @@ -1224,51 +1477,85 @@ tags: ```
back to top
- name: Requests and Responses x-traitTag: true - description: | + description: > ## Asset URLs + All asset URLs returned by the Lob API (postcards, letters, thumbnails, + etc) are signed links served over HTTPS. All links returned will expire in + 30 days to prevent mis-sharing. Each time a GET request is initiated, a + new signed URL will be generated. +
+
back to top
+ ## Query Parameters + Query parameters which consist of lists of strings require that all elements of + the list be double-quoted, as per query filter standards. +
+
back to top
+ ## Idempotent Requests + Lob supports idempotency for safely retrying `POST` requests to create + postcards, self mailers, letters, and checks without accidentally creating + duplicates. + For example, if a request to create a check fails due to a network error, + you can safely retry the same request with the same idempotency key and + guarantee that only one check will ultimately be created and sent. When a + request is sent with an idempotency key for an already created resource, + the response object for the existing resource will be returned. + To perform an idempotent `POST` request to one of the mailpiece product + endpoints, provide an additional `Idempotency-Key` header or an `idempotency_key` + query parameter to the request. If multiple idempotency keys are provided, + the request will fail. How you create unique keys is up to you, but we + suggest using random values, such as V4 UUIDs. Idempotency keys are intended + to prevent issues over a short periods of time, therefore keys expire after + 24 hours. Keys are unique by mode (Test vs. Live) as well as by resource + (postcard vs. letter, etc.). + By default, all `GET` and `DELETE` requests are idempotent by nature, so + they do not require an additional idempotency key. + For more help integrating idempotency keys, refer to our + implementation guide. + **Headers** + @@ -1286,7 +1573,9 @@ tags:
+ **Query Parameters** + @@ -1304,8 +1593,10 @@ tags:
+ ### Example Request + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1316,21 +1607,32 @@ tags: --data-urlencode "back=Back HTML" \ -d "merge_variables[name]=Harry" ``` +
+
back to top
+ ## Metadata + When creating any Lob object, you can include a metadata object with up to 20 key-value pairs of + custom data. You can use metadata to store information like `metadata[customer_id] = "987654"` or + `metadata[campaign] = "NEWYORK2015"`. This is especially useful for filtering and matching to internal + systems. + Each metadata key must be less than 40 characters long and values must be less than 500 characters. + Metadata does not support nested objects. + ### Example Create Request with Metadata + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1343,45 +1645,67 @@ tags: -d "merge_variables[name]=Harry" ``` + ### Example List Request with Metadata Filter + ```bash curl -g "https://api.lob.com/v1/postcards?metadata[campaign]=NEWYORK2015&limit=2" \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: ``` +
+
back to top
+ ## Request Body + When manually sending a POST HTTP request directly to the Lob API, without + the use of a library, you may represent the body as either a Form URL + Encoded request, a JSON document, or a Multipart Form Data request. + However, if you're using one of our [SDKs](#tag/SDKs-and-Tools), + the generation of the request bodies is done for you automatically and you don't + need to worry about the format. + ### Form URL Encoded + This request body encoding is accompanied with the + `Content-Type: application/x-www-form-urlencoded` header. The content is an + example of what the [Verify a US address](index.html#operation/us_verification) + endpoint accepts. An example of a request body encoded in this format follows. + ```javascript primary_line=210 King Street&city=San Francisco&state=CA&zip_code=94107 ``` + ### JSON + This request body encoding is accompanied with the `Content-Type: application/json` header. + The content is an example of what the [Verify a US address endpoint](index.html#operation/us_verification) + accepts. An example of a request body encoded in this format follows. + ```javascript { "primary_line": "210 King Street", @@ -1391,14 +1715,20 @@ tags: } ``` + ### Multipart Form Data + This request body encoding is accompanied with the `Content-Type: multipart/form-data` + header. This is the only format that can be used for uploading a file to the API. The + content is an example of what the [Create a check](index.html#operation/check_create) + endpoint accepts. An example of a request body encoded in this format follows. + ```javascript --------------------------7015ebe79c0a5f8c Content-Disposition: form-data; name="description" @@ -1423,54 +1753,90 @@ tags: true --------------------------7015ebe79c0a5f8c-- ``` +
back to top
- name: Reverse Geocode Lookups - description: | - Find a list of zip codes associated with a valid US location via latitude and longitude.
back to top
+ description: > + Find a list of zip codes associated with a valid US location via latitude + and longitude.
back to top
- name: SDKs and Tools x-traitTag: true - description: | - Please visit our Github for a list of our supported libraries. + description: > + Please visit our Github for a list of our supported libraries. + - Typescript + - PHP + - Python + - Java + - Ruby + - CSharp + - Elixir + - Go + - Node.js (legacy) + - Java (legacy) + - PHP (legacy) + - Python (Legacy) + - Ruby (Legacy) +

+
back to top
- name: Self Mailers - description: | - The self mailer endpoint allows you to easily print and mail self mailers. The API provides endpoints + description: > + The self mailer endpoint allows you to easily print and mail self mailers. + The API provides endpoints + for creating self mailers, retrieving individual self mailers, canceling self mailers, and retrieving a list of self mailers. +
back to top
- name: Template Design x-traitTag: true - description: | + description: > ## HTML Templates + You can save commonly used HTML as templates within Lob to more easily manage them. You can reference + your saved templates in postcard, letter, and check requests instead of having to pass a long HTML + string on each request. Additionally, you can make changes to your HTML templates and update them + independently, without having to touch your API integration. Templates can be created, edited, + and viewed on your Dashboard. To use a template in a postcard, + letter, or check, see the documentation for each endpoint below. For help using templates, check out our + HTML Templates Guide or get started with a + pre-designed template from our gallery. In Live mode, you can only have + as many templates as allotted in your current + Print & Mail Edition. There is no limit in Test mode. + If you'd like to interact with templates programmatically, check out our Beta Program for API access + to the [HTML Templates Endpoints](#tag/Templates). + ### Example Create Request using HTML Templates + ```bash curl https://api.lob.com/v1/postcards \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ @@ -1481,83 +1847,144 @@ tags: -d "back=tmpl_01b0d396a10c268" \ -d "merge_variables[name]=Harry" ``` +
+
back to top
+ ## HTML Examples + Use a pre-designed template from our gallery or follow these + basic guidelines as starting points for creating custom Postcards, + Self Mailers, Letters, and Checks. + Please follow the standards used in these templates, such as: + - For any linked assets, you must use a performant file hosting provider with no rate limits such as Amazon + S3. + - Use inline styles or an internal stylesheet, do not link to external stylesheets. + - Link to images that are 300DPI and sized at the final desired size on the physical mailing. For example, + for a photo that is desired to be 1in x 1in on the final postcard, the image asset should be sized at 1in + x 1in at 300DPI (which equates to 300px by 300px). + - The sum of all linked assets should not exceed 5MB in file size. + - Use `-webkit` prefixes for CSS properties when recommended here. + Because different browsers have varying user-agent styles, the HTML you see in your browser will not + always look identical to what is produced through the API. It is **strongly** recommended that you test all + HTML requests by reviewing the final PDF files in your Test Environment, as these are the files that will be + printed. +
+
back to top
+ ## Image Prepping + Currently we support the following file types for all endpoints: + - PDF + - PNG + - JPEG + **Templates** + You can find pre-made templates that already adhere to all of these guidelines here: + - [Postcards](#tag/Postcards) + - [Letters](#tag/Letters) + - [Checks](#tag/Checks) + - [Self Mailers](#tag/Self-Mailers) + **Prepping All Images** + The following guidelines apply to image types: + - Images should be 300 dpi or higher - PNG/JPEG files with less than 300 dpi will be rejected. + - Your artwork should include a 1/8" border around the final trim size. This means your final file size will be a total of 0.25" larger than your expected printed piece (ie, a 4"x6" postcard should be submitted as 4.25"x6.25"). There is no need to include crop marks in your submitted content. + - Include a safe zone – make sure no critical elements are within 1/8" from the edge of the final size. + - Do not include any additional postage marks or indicia. + - File sizes should be no larger than 5MB. + **Prepping PDFs** + To ensure that you are producing PDF's correctly please follow the guidelines below: + - [Make sure all non-standard fonts are embedded.](#section/Standard-PDF-Fonts) + - Generated PDF's need to be be PDF/A compliant. + **Prepping PNGs/JPEGs** + To ensure that you are producing PNG's/JPEG's correctly please follow the guidelines below: + - Minimum 300 dpi. The dpi is calculated as (width of image in pixels) / (width of product in inches) and (length of image in pixels) / (length of product in inches). For Example: 1275px x 1875px image used to create a 4.25" x 6.25" postcard has a dpi of 300. + - Submitted images must have the same length to width ratio as the chosen product. Images will not be cropped or stretched by the API. +
+
back to top
+ ## Standard PDF Fonts + Ideally, all fonts in provided PDFs should be embedded. Embedding a font in a PDF ensures that the final + printed product will look as it was designed. Fonts can vary greatly in size and shape, even within the + same family. If the exact font that was used to design the artwork is not used to print, the look and + placement of the text is not guaranteed to be the same. + In general, requests that provide PDFs with un-embedded fonts will be rejected. We make an exception for + "standard fonts", a set of fonts that we have identified as being common. PDFs that contain un-embedded + fonts that are found in the list, and match the accepted font type + will be accepted. Otherwise, the request will be rejected. + Font embedding is an essential part of standard PDF workflows. Fonts should be embedded automatically by + PDF editing software that are compliant with PDF standards. + @@ -1736,55 +2163,89 @@ tags:
FONT NAMEType 1
+
back to top
- name: Template Versions - description: | - These API endpoints allow you to create, retrieve, update and delete versions of reusable HTML templates for use with the Print & Mail API. + description: > + These API endpoints allow you to create, retrieve, update and delete + versions of reusable HTML templates for use with the Print & Mail API. +
back to top
- name: Templates - description: | - These API endpoints allow you to create, retrieve, update and delete reusable HTML templates for use with the Print & Mail API. + description: > + These API endpoints allow you to create, retrieve, update and delete + reusable HTML templates for use with the Print & Mail API. +
back to top
- name: Test and Live Environments x-traitTag: true - description: | + description: > To make the API as explorable as possible, accounts have test and live + environment API keys. You're not charged any fees in the test environment, + so we encourage you to use it to try out services, perform quality + assurance, and run automated testing. Objects―addresses, letters, checks, + etc―in one environment cannot be manipulated by objects in the other. + In general, a payment method (either credit card or ACH account) must be + added to your account to make live API requests. However, a payment method + is not required for the first 300 live requests per month to the + `/v1/us_verifications` endpoint. After the first 300 requests, you will + begin receiving errors with status code `403`. + Requests made in the test environment always validate request arguments, + simulate live environment behavior, and enforce rate limits. _They never + print, mail nor, for verification services, verify addresses._ The US & + International verification services trigger behavior with specific + argument values, and, if you plan on using those, we recommend reading + [US Verification Test Environment](#tag/US-Verifications-Test-Environment) + and [Intl Verification Test Environment](#tag/Intl-Verifications-Test-Environment). + To switch between environments, use the appropriate key for that + environment when performing a request. You can find each environment's API + key in your dashboard under Settings; test API keys are always prefixed + with `test_` and production API keys with `live_`. +
back to top
- name: Tracking Events - description: | - As mailpieces travel through the mail stream, USPS scans their unique barcodes, and Lob processes these mail scans to generate tracking events. + description: > + As mailpieces travel through the mail stream, USPS scans their unique + barcodes, and Lob processes these mail scans to generate tracking events. +

Certified Tracking Event Details

+ Letters sent with USPS Certified Mail are fully tracked by USPS, and + therefore their [tracking events](#operation/tracking_event) have an + additional `details` object with more detailed information about the + tracking event. The following table shows the potential values for + the fields in the `details` object mapped to the tracking event `name`. + @@ -1955,27 +2416,43 @@ tags:
NAMEfalse
+
back to top
- name: Uploads - description: | - The uploads endpoint allows you to upload audience files that are then associated with a given campaign. + description: > + The uploads endpoint allows you to upload audience files that are then + associated with a given campaign. + At this time, only CSV files are allowed. The API provides endpoints for creating uploads, uploading audience files, + and marking uploaded files as ready for processing. The API also provides endpoints for downloading files that + describe the results, both successful and not, of the processing. - name: URL Shortener - description: | - Lob's URL shortener allows you to generate unique short links, either with Lob's own domain or your own custom domains. Each custom link enables Lob to track mail individually and provide customers the relevant tracking data in their dashboard. + description: > + Lob's URL shortener allows you to generate unique short links, either with + Lob's own domain or your own custom domains. Each custom link enables Lob + to track mail individually and provide customers the relevant tracking + data in their dashboard. + Webhooks can be used to integrate Lob's URL Shortener scans into your omni channel marketing stratergy. See the Webhooks section of our documentation to learn how to enable the `letter.viewed`, `postcard.viewed` and `self_mailer.viewed` event notifications for your mail pieces. + Furthermore, you can use our Retrieve endpoints to track the impact and engagement rate of links created. +
back to top
- name: US Autocompletions - description: | - Given partial address information, this endpoint returns up to 10 address suggestions.
back to top
+ description: > + Given partial address information, this endpoint returns up to 10 address + suggestions.
back to top
+ ## Autocompletion Test Env + Your test API key does not autocomplete US addresses and is used to simulate behavior. With your test API key, requests with specific values for `address_prefix` return predetermined values. When `address_prefix` is set to: + - `0 suggestions` - Returns no suggestions - `[PRIMARY NUMBER] s[uggestion]` - Returns a maximum of ten predefined suggested addresses. `[PRIMARY NUMBER]` does not have to be a valid primary number when sending a test request. Each additional letter in `suggestion` reduces the number of suggestions by one (e.g. @@ -1983,14 +2460,18 @@ tags: suggestions returned. City and state filters work as expected and filter the list of predetermined suggested addresses. + See the `test` request & response examples under [Autocomplete Examples](#operation/autocompletion) within the "Autocomplete a partial address" section in US Autocompletions.
back to top
- name: US Verification Types x-traitTag: true - description: | - These are detailed definitions for various fields in the [US verification object](#operation/us_verification). + description: > + These are detailed definitions for various fields in the [US verification + object](#operation/us_verification). +

ZIP Code Types - components[zip_code_type]

+ @@ -2016,8 +2497,10 @@ tags:
+

Record Types - components[record_type]

+ @@ -2051,8 +2534,10 @@ tags:
+

Carrier Route Types - components[carrier_route_type]

+ @@ -2082,8 +2567,10 @@ tags:
+

DPV Footnotes - deliverability_analysis[dpv_footnotes]

+ @@ -2148,21 +2635,31 @@ tags:
+
back to top
- name: US Verifications - description: | + description: > Validate, automatically correct, and standardize the addresses in your + address book based on USPS's Coding Accuracy Support System (CASS). +
+
back to top
+ ## US Verifications Test Env + When verifying US addresses, you'll likely want to test against a wide array of addresses to + ensure you're handling responses correctly. With your test API key, requests that use specific + values for `address` or `primary_line` and (if using `primary_line`) an arbitrary five digit + number for `zip_code` (e.g. "11111") let you explore the responses to many types of addresses: + @@ -2241,74 +2738,119 @@ tags:
ADDRESS TYPE FOR SAMPLE RESPONSE
+ See the `test` request & response examples under [US Verification Examples](#operation/us_verification) within the + "Verify a US or US territory address" section in US Verifications. + You can rely on the response from these examples generally matching the response you'd see in the live environment with an + address of that type (excluding the `recipient` field). + The test API key does not perform any verification, automatic correction, or standardization for addresses. If you wish to + try these features out, use our live demo or the free plan (see our pricing for details). +
back to top
- name: Versioning and Changelog x-traitTag: true - description: | + description: > ### API Versioning + When backwards-incompatible changes are made to the API, a new dated version + is released. The latest version of the API is version **2020-02-11**. + All versions prior to, and inclusive of, 2019-02-11 have been sunsetted. You can + view your version and upgrade to the latest version in your + Dashboard Settings. You will + only need to specify a version if you would like to test a newer version of + the API without doing a full upgrade. The API will return an error if a + version older than your current one is passed in. + ### Example Request + ```bash curl https://api.lob.com/v1/addresses \ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \ -H "Lob-Version: 2020-02-11" ``` + ### Specification Versioning + You might be wondering why our API and specification use different versioning schemes. + Lob's API predates our specification and follows the Stripe versioning + approach. This works well to manage backwards-incompatible changes to our API. + For our API specification (used to create this documentation), we've chosen semantic + versioning. This versioning reflects the backward-compatible + changes that do not require a versioning of Lob's API. + Lob's API specification will be used to generate artifacts like documentation, client SDKs, + and other developer tooling. Semantic versioning of our specification will inform how we + version those artifacts like SDKs. It is helpful to know the version of a specification + used to produce an artifact in order reference the specification release notes. + ### Changelog View our Changelog here. - name: Webhooks x-traitTag: true - description: | - Webhooks are an easy way to get notifications on events happening asynchronously + description: > + Webhooks are an easy way to get notifications on events happening + asynchronously + within Lob's architecture. For example, when a postcard gets a "Processed For + Delivery" tracking event, an event object of type `postcard.processed_for_delivery` + will be created. If you are subscribed to that event type in that Environment + (Test vs. Live), Lob will send that event to any URLs you've specified via an + HTTP POST request. In Live mode, you can only have as many webhooks as allotted + in your current Print & Mail Edition. + There is no limit in Test mode. + You can view and create webhooks on the + Lob Dashboard, as well as view your events. + See our Webhooks Integration Guide for more + details on how to integrate. Please see the full list of event types available for + subscription here. +
back to top
- name: Zip Lookups - description: | - Find a list of cities, states and associated information about a US ZIP code.
back to top
+ description: > + Find a list of cities, states and associated information about a US ZIP + code.
back to + top
x-tagGroups: - name: Overview tags: @@ -2401,23 +2943,23 @@ paths: $ref: resources/accounts/accounts.yml /addresses: $ref: resources/addresses/addresses.yml - /addresses/{adr_id}: + "/addresses/{adr_id}": $ref: resources/addresses/address.yml - /bank_accounts/{bank_id}/verify: + "/bank_accounts/{bank_id}/verify": $ref: resources/bank_accounts/bank_account_verify.yml - /bank_accounts/{bank_id}: + "/bank_accounts/{bank_id}": $ref: resources/bank_accounts/bank_account.yml /bank_accounts: $ref: resources/bank_accounts/bank_accounts.yml - /billing_groups/{bg_id}: + "/billing_groups/{bg_id}": $ref: resources/billing_groups/billing_group.yml /billing_groups: $ref: resources/billing_groups/billing_groups.yml /buckslips: $ref: resources/buckslips/buckslips.yml - /buckslips/{buckslip_id}: + "/buckslips/{buckslip_id}": $ref: resources/buckslips/buckslip.yml - /buckslips/{buckslip_id}/orders: + "/buckslips/{buckslip_id}/orders": $ref: resources/buckslips/buckslip_orders/buckslip_orders.yml /bulk/us_verifications: $ref: resources/bulk_us_verifications/bulk_us_verifications.yml @@ -2425,23 +2967,23 @@ paths: $ref: resources/bulk_intl_verifications/bulk_intl_verifications.yml /campaigns: $ref: resources/campaigns/campaigns.yml - /campaigns/{cmp_id}: + "/campaigns/{cmp_id}": $ref: resources/campaigns/campaign.yml - /campaigns/{cmp_id}/send: + "/campaigns/{cmp_id}/send": $ref: resources/campaigns/send.yml /cards: $ref: resources/cards/cards.yml - /cards/{card_id}: + "/cards/{card_id}": $ref: resources/cards/card.yml - /cards/{card_id}/orders: + "/cards/{card_id}/orders": $ref: resources/cards/card_orders/card_orders.yml /checks: $ref: resources/checks/checks.yml - /checks/{chk_id}: + "/checks/{chk_id}": $ref: resources/checks/check.yml /creatives: $ref: resources/creatives/creatives.yml - /creatives/{crv_id}: + "/creatives/{crv_id}": $ref: resources/creatives/creative.yml /identity_validation: $ref: resources/identity_validation/identity_validation.yml @@ -2449,53 +2991,53 @@ paths: $ref: resources/intl_autocompletions/intl_autocompletions.yml /intl_verifications: $ref: resources/intl_verifications/intl_verifications.yml - /letters/{ltr_id}: + "/letters/{ltr_id}": $ref: resources/letters/letter.yml /letters: $ref: resources/letters/letters.yml - /postcards/{psc_id}: + "/postcards/{psc_id}": $ref: resources/postcards/postcard.yml /postcards: $ref: resources/postcards/postcards.yml /qr_code_analytics: $ref: resources/qr_codes/qr_codes.yml - /domains/{domain_id}: + "/domains/{domain_id}": $ref: resources/url_shortener/domain_id.yml /domains: $ref: resources/url_shortener/domain_non_id.yml - /domains/{domain_id}/links: + "/domains/{domain_id}/links": $ref: resources/url_shortener/domains.yml /links: $ref: resources/url_shortener/links_list.yml - /links/{link_id}: + "/links/{link_id}": $ref: resources/url_shortener/links_id.yml /links/shorten: $ref: resources/url_shortener/links_shorten.yml /links/shorten/bulk: $ref: resources/url_shortener/links_bulk.yml - /self_mailers/{sfm_id}: + "/self_mailers/{sfm_id}": $ref: resources/self_mailers/self_mailer.yml /self_mailers: $ref: resources/self_mailers/self_mailers.yml - /templates/{tmpl_id}/versions/{vrsn_id}: + "/templates/{tmpl_id}/versions/{vrsn_id}": $ref: resources/templates/template_versions/template_version.yml - /templates/{tmpl_id}/versions: + "/templates/{tmpl_id}/versions": $ref: resources/templates/template_versions/template_versions.yml - /templates/{tmpl_id}: + "/templates/{tmpl_id}": $ref: resources/templates/template.yml /templates: $ref: resources/templates/templates.yml /uploads: $ref: resources/uploads/uploads.yml - /uploads/{upl_id}: + "/uploads/{upl_id}": $ref: resources/uploads/upload.yml - /uploads/{upl_id}/file: + "/uploads/{upl_id}/file": $ref: resources/uploads/file.yml - /uploads/{upl_id}/exports: + "/uploads/{upl_id}/exports": $ref: resources/uploads/exports.yml - /uploads/{upl_id}/report: + "/uploads/{upl_id}/report": $ref: resources/uploads/report.yml - /uploads/{upl_id}/exports/{ex_id}: + "/uploads/{upl_id}/exports/{ex_id}": $ref: resources/uploads/export.yml /us_autocompletions: $ref: resources/us_autocompletions/us_autocompletions.yml diff --git a/package-lock.json b/package-lock.json index 3766ddfc..4f95f738 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@lob/openapi", - "version": "1.19.22", + "version": "1.19.23", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 42d69706..05193f11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lob/openapi", - "version": "1.19.22", + "version": "1.19.23", "engines": { "node": ">=14.16.0", "npm": ">=7.9.0" diff --git a/resources/checks/checks.yml b/resources/checks/checks.yml index 7af7a124..c67710c0 100644 --- a/resources/checks/checks.yml +++ b/resources/checks/checks.yml @@ -20,6 +20,7 @@ get: - $ref: "../../shared/parameters/send_date.yml" - $ref: "../../shared/parameters/mail_type.yml" - $ref: "../../shared/parameters/sort_by.yml" + - $ref: "../../shared/parameters/status.yml" responses: "200": diff --git a/resources/checks/models/check.yml b/resources/checks/models/check.yml index ab6d32f0..fceafb34 100644 --- a/resources/checks/models/check.yml +++ b/resources/checks/models/check.yml @@ -83,11 +83,7 @@ allOf: $ref: "../attributes/chk_use_type.yml" status: - title: The status of the check. - enum: - - processed - - rendered - - failed + $ref: "../../../shared/attributes/status.yml" failure_reason: allOf: diff --git a/resources/letters/letters.yml b/resources/letters/letters.yml index 93672c7f..144513eb 100644 --- a/resources/letters/letters.yml +++ b/resources/letters/letters.yml @@ -16,6 +16,8 @@ get: - $ref: "../../shared/parameters/include.yml" - $ref: "../../shared/parameters/date_created.yml" - $ref: "../../shared/parameters/metadata.yml" + - $ref: "../../shared/parameters/campaign_id.yml" + - $ref: "../../shared/parameters/status.yml" - in: query name: color description: Set to `true` to return only color letters. Set to `false` to return only black & white letters. diff --git a/resources/letters/models/letter_generated_base.yml b/resources/letters/models/letter_generated_base.yml index 0ae11c69..f44aad96 100644 --- a/resources/letters/models/letter_generated_base.yml +++ b/resources/letters/models/letter_generated_base.yml @@ -28,9 +28,7 @@ allOf: - $ref: "../../../shared/attributes/model_ids/vrsn_id.yml" campaign_id: - type: string - description: The unique ID of the associated campaign if the resource was generated from a campaign. - nullable: true + $ref: "../../../shared/attributes/campaign_id.yml" use_type: $ref: "../attributes/ltr_use_type.yml" @@ -41,11 +39,7 @@ allOf: default: false status: - title: The status of the letter. - enum: - - processed - - rendered - - failed + $ref: "../../../shared/attributes/status.yml" failure_reason: allOf: diff --git a/resources/postcards/models/postcard.yml b/resources/postcards/models/postcard.yml index d93c0ac9..d3f4d715 100644 --- a/resources/postcards/models/postcard.yml +++ b/resources/postcards/models/postcard.yml @@ -51,9 +51,7 @@ allOf: $ref: "../../../shared/attributes/signed_link.yml" campaign_id: - type: string - description: The unique ID of the associated campaign if the resource was generated from a campaign. - nullable: true + $ref: "../../../shared/attributes/campaign_id.yml" use_type: $ref: "../attributes/psc_use_type.yml" @@ -64,11 +62,7 @@ allOf: default: false status: - title: The status of the postcard. - enum: - - processed - - rendered - - failed + $ref: "../../../shared/attributes/status.yml" failure_reason: allOf: diff --git a/resources/postcards/postcards.yml b/resources/postcards/postcards.yml index bda4a732..5a3831d0 100644 --- a/resources/postcards/postcards.yml +++ b/resources/postcards/postcards.yml @@ -16,6 +16,8 @@ get: - $ref: "../../shared/parameters/include.yml" - $ref: "../../shared/parameters/date_created.yml" - $ref: "../../shared/parameters/metadata.yml" + - $ref: "../../shared/parameters/campaign_id.yml" + - $ref: "../../shared/parameters/status.yml" - in: query name: size description: Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations. diff --git a/resources/self_mailers/models/self_mailer.yml b/resources/self_mailers/models/self_mailer.yml index f7610ccf..e0ded4cc 100644 --- a/resources/self_mailers/models/self_mailer.yml +++ b/resources/self_mailers/models/self_mailer.yml @@ -68,11 +68,10 @@ allOf: default: false status: - title: The status of the self mailer. - enum: - - processed - - rendered - - failed + $ref: "../../../shared/attributes/status.yml" + + campaign_id: + $ref: "../../../shared/attributes/campaign_id.yml" failure_reason: allOf: diff --git a/resources/self_mailers/self_mailers.yml b/resources/self_mailers/self_mailers.yml index 48ec0edc..2fb2a7d5 100644 --- a/resources/self_mailers/self_mailers.yml +++ b/resources/self_mailers/self_mailers.yml @@ -28,6 +28,8 @@ get: - $ref: "../../shared/parameters/send_date.yml" - $ref: "../../shared/parameters/mail_type.yml" - $ref: "../../shared/parameters/sort_by.yml" + - $ref: "../../shared/parameters/campaign_id.yml" + - $ref: "../../shared/parameters/status.yml" responses: "200": diff --git a/shared/attributes/campaign_id.yml b/shared/attributes/campaign_id.yml new file mode 100644 index 00000000..7cdadc88 --- /dev/null +++ b/shared/attributes/campaign_id.yml @@ -0,0 +1,5 @@ +title: campaign_id +description: Denotes resources created by the provided campaign id, prefixed with `cmp_`. +type: string +pattern: "^cmp_[a-zA-Z0-9]+$" +nullable: true diff --git a/shared/attributes/status.yml b/shared/attributes/status.yml new file mode 100644 index 00000000..2ab0fc1b --- /dev/null +++ b/shared/attributes/status.yml @@ -0,0 +1,12 @@ +type: string + +enum: + - processed + - rendered + - failed + +description: | + A string describing the PDF render status: + * `processed` - the rendering process is currently in progress. + * `rendered` - a PDF has been successfully rendered of the mailpiece. + * `failed` - one or more issues has caused the rendering process to fail. diff --git a/shared/parameters/campaign_id.yml b/shared/parameters/campaign_id.yml new file mode 100644 index 00000000..e853c062 --- /dev/null +++ b/shared/parameters/campaign_id.yml @@ -0,0 +1,9 @@ +in: query + +name: campaign_id +required: false + +description: Filters resources created by the provided campaign id, prefixed with `cmp_`. + +schema: + $ref: "../attributes/campaign_id.yml" diff --git a/shared/parameters/status.yml b/shared/parameters/status.yml new file mode 100644 index 00000000..790c1a9f --- /dev/null +++ b/shared/parameters/status.yml @@ -0,0 +1,10 @@ +in: query +name: status +description: | + A string describing the render status: + * `processed` - the rendering process is currently underway. + * `rendered` - the rendering process has completed successfully. + * `failed` - the rendering process has failed. + +schema: + $ref: "../attributes/status.yml"