Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
amaan-lob committed Oct 7, 2024
1 parent aa3f003 commit ee8209b
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lob-api-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ tags:
<div class="back-to-top" ><a href="#" onclick="toTopLink()">back to top</a></div>
- name: QR Codes
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 <a href="#tag/Letters/operation/letter_create">Letters</a>, <a href="#tag/Postcards/operation/postcard_create">Postcards</a> or <a href="#tag/Self-Mailers/operation/self_mailer_create">Self Mailers</a> 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 <a href="#tag/Webhooks">Webhooks</a> section of our documentation to learn how to enable the `letter.viewed`, `postcard.viewed` and `self_mailer.viewed` event notifications for your mail pieces.
Expand Down
2 changes: 1 addition & 1 deletion resources/url_shortener/attributes/error_redirect_link.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
type: string

description: The 404 error redirect link.
description: URL to redirect customers if a short link is broken or inactive.
12 changes: 12 additions & 0 deletions resources/url_shortener/domains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ get:
tags:
- URL Shortener

parameters:
- $ref: ../../shared/parameters/limit.yml
- $ref: ../../shared/parameters/before_after.yml
- in: query
name: status
description: Filter domains by their configuration status.
schema:
type: string
enum:
- configured
- not_configured

responses:
"200":
description: Returns a list of all domains.
Expand Down
9 changes: 8 additions & 1 deletion resources/url_shortener/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ get:
- URL Shortener
parameters:
- $ref: "../../shared/parameters/limit.yml"
- $ref: "../../shared/parameters/offset.yml"
- $ref: "../../shared/parameters/before_after.yml"
- $ref: "../../shared/parameters/campaign_id.yml"
- in: query
name: domain_id
description: Filters links by the provided domain id.
schema:
type: string
pattern: "^(dom)_[a-zA-Z0-9]+$"

responses:
"200":
Expand Down
1 change: 1 addition & 0 deletions resources/url_shortener/models/link_single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ properties:
$ref: "../attributes/redirect_link.yml"
domain:
description: The registered domain to be used for the short URL.
default: "lob.st"
type: string
slug:
description: The unique path for the shortened URL, if empty a unique path will be used.
Expand Down
8 changes: 7 additions & 1 deletion resources/url_shortener/responses/domain_response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ properties:
description: The registered domain/hostname.
type: string
error_redirect_link:
description: The 404 error redirect link.
description: URL to redirect customers if a short link is broken or inactive.
type: string
status:
description: The configuration status of the domain.
type: string
enum:
- configured
- not_configured
created_at:
description: The date and time the domain was created.
type: string
Expand Down
17 changes: 9 additions & 8 deletions resources/url_shortener/responses/domains_response.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
type: object

properties:
data:
type: array
description: List of domains.
items:
$ref: "domain_response.yml"
allOf:
- $ref: "../../../shared/models/list.yml"
- type: object
properties:
data:
type: array
description: List of domains.
items:
$ref: "domain_response.yml"
6 changes: 6 additions & 0 deletions resources/url_shortener/responses/link_response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ properties:
type: string
metadata:
$ref: "../../../shared/models/metadata.yml"
created_at:
description: The date and time the link was created.
type: string
updated_at:
description: The date and time the link was last updated.
type: string
27 changes: 9 additions & 18 deletions resources/url_shortener/responses/links_response.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
type: object

properties:
count:
type: integer
description: The number of results in the current response.
limit:
type: integer
description: How many results to return.
offset:
type: integer
description: An integer that designates the offset at which to begin returning results. Defaults to 0.
data:
type: array
description: >
list of links
items:
$ref: "link_response.yml"
allOf:
- $ref: "../../../shared/models/list.yml"
- type: object
properties:
data:
type: array
description: List of links
items:
$ref: "link_response.yml"

0 comments on commit ee8209b

Please sign in to comment.