Pigeon Protocol API
Info/Context
Type: API documentation
Audience: Pigeon Protocol users and third-party developers
Purpose: An API reference for the fictitious Pigeon Protocol service, a global delivery network that lets users send messages via carrier pigeon. (Not a functional API, sadly... although if any pigeon breeders happen to be reading this, let's talk!)
You can use the Pigeon Protocol API to dispatch pigeon couriers directly from your command line. Every message you submit is automatically assigned to one of our Pigeon Protocol partners for delivery—and since our courier network spans all seven continents, this means you can send messages to recipients anywhere in the world.
When you submit a message to the Pigeon Protocol API via the Create new message endpoint, your message gets added to our processing queue.
If a message is still in the processing queue, you can use the Edit queued message and Delete queued message endpoints to modify or cancel your message. However, after a pigeon courier has initiated delivery, you won't be able to modify or cancel that message; you can use the Check message status endpoint beforehand to determine whether your message is still in the processing queue (and therefore still possible to modify or cancel).
The Pigeon Protocol API uses request-level authentication via Basic auth. To authenticate a request, provide an Authorization header with the value Basic base64(username:password)
. For example, if your Pigeon Protocol Auth ID is feather
and your Pigeon Protocol Auth Key is secret
, your Authorization header should be set to Basic ZmVhdGhlcjpzZWNyZXQ=
.
Create new message
Adds a new message to the Pigeon Protocol processing queue.
Authorizations:
path Parameters
account required | string Example: featherfan92 The username of your Pigeon Protocol account. |
Request Body schema: application/jsonrequired
required | object Information about the destination where our pigeon courier should send your message. |
required | object Information about the message to send via Pigeon Protocol. |
object Information about when you'd like our pigeon courier to deliver your message. If you include both a | |
requestedCourier | Array of strings Any specific pigeon courier(s) who you'd like to deliver the message on your behalf. Must be an array of |
object Other options related to your message and its delivery. |
Responses
Request samples
- Payload
{- "destination": {
- "recipientId": "halfnelson",
- "address": "Russell Sparks \n 4343 Libby Street \n Santa Monica, CA \n 90405"
}, - "message": {
- "subject": "Dinner on Tuesday?",
- "messageBody": "Hey Russ! \n I'll be in town soon and was thinking we could catch up over pizza... how does Tuesday sound? \n Let me know if that sounds a little too cheesy or if a different day works better for you. \n - Ron \n P.S. Mom says hi :)",
- "urgent": true,
- "responseRequested": true
}, - "timeframe": {
- "min": "2022-03-16T10:30:00.000Z",
- "max": "2022-03-18T17:00:00.000Z"
}, - "requestedCourier": [
- "CPL593H",
- "ZDMRRBE",
- "722JBTS"
], - "extras": {
- "senderAlias": "RonPersonalAddress",
- "birthday": false,
- "requireSignature": true
}
}
Response samples
- 201
{- "msgId": "4prDjddvmLpDA2A2",
- "status": "queued",
- "eta": "2022-03-18T09:30:00.000Z",
- "cost": 0.15
}
Check message status
Queries the status of the specified message in the Pigeon Protocol system. Depending on your message's status, this endpoint will return different response types with status-specific data.
There are four possible statuses:
queued
: Your message is still in the Pigeon Protocol's processing queue and awaiting delivery.enroute
: A pigeon courier is in the process of delivering your message.delivered
: A pigeon courier has successfully delivered your message.refunded
: Your message was deleted or otherwise ineligible for delivery. A refund has been applied to your Pigeon Protocol account.
Authorizations:
path Parameters
account required | string Example: featherfan92 The username of your Pigeon Protocol account. |
msgId required | string Example: 8504913 The ID of the message whose status you'd like to query. This must match the value of the |
Responses
Response samples
- 200
{- "msgId": "4prDjddvmLpDA2A2",
- "status": "queued",
- "eta": "2022-03-18T09:30:00.000Z",
- "cost": 0.15
}
Edit queued message
Modifies the specified message in the Pigeon Protocol processing queue. You can edit any of the message's parameters, including its recipient, contents, and delivery options.
Note that updating certain parameters may increase or decrease the cost of your message.
Authorizations:
path Parameters
account required | string Example: featherfan92 The username of your Pigeon Protocol account. |
msgId required | string Example: 8504913 The ID of the message you'd like to edit. This must match the value of the |
Request Body schema: application/jsonrequired
msgId required | string The message's unique Pigeon Protocol ID. This must match the value of the |
required | object Any message information you'd like to edit. This object must follow the same core structure as the request body of the Create new message endpoint, but you can omit any children/parameters whose values you don't want to change. |
Responses
Request samples
- Payload
{- "msgId": "4prDjddvmLpDA2A2",
- "msgInfo": {
- "message": {
- "subject": "Pizza on Tuesday?"
}, - "extras": {
- "requireSignature": false
}
}
}
Response samples
- 200
{- "msgId": "4prDjddvmLpDA2A2",
- "status": "queued",
- "eta": "2022-03-22T09:30:00.000Z",
- "cost": 0.12
}
Cancel queued message
Deletes the specified message in the Pigeon Protocol processing queue.
If your message is deleted successfully, we'll apply a refund to your Pigeon Protocol account.
Authorizations:
path Parameters
account required | string Example: featherfan92 The username of your Pigeon Protocol account. |
msgId required | string Example: 8504913 The ID of the message you'd like to cancel. This must match the value of the |
Responses
Response samples
- 204
{- "msgId": "4prDjddvmLpDA2A2",
- "status": "refunded",
- "cost": 0.15
}
Check courier availability
Queries the status of a specified pigeon courier.
If you don't include a pgnId
value in your request, this endpoint will return the status of all pigeon couriers in the region associated with your Pigeon Protocol account.
Authorizations:
path Parameters
account required | string Example: featherfan92 The username of your Pigeon Protocol account. |
query Parameters
pgnId | string Example: pgnId=CPL593H The alphanumeric ID of the pigeon courier whose status you'd like to query. |
Responses
Response samples
- 200
{- "pgnId": "CPL953H",
- "pgnStatus": "busy",
- "region": "US_SW",
- "variety": "mondain"
}
Send tip to courier
Gives a thimble of birdseed to the specified courier. For each tip you send, a $0.05 USD charge will be billed to your account.
Note that this endpoint does not expect a request body; instead, use the pgnId
query parameter to specify the courier of your choosing.
Authorizations:
path Parameters
account required | string Example: featherfan92 The username of your Pigeon Protocol account. |
query Parameters
pgnId required | string Example: pgnId=CPL593H The alphanumeric ID of the pigeon courier who you'd like to tip. |