Skip to content

Instantly share code, notes, and snippets.

@timd
Created March 30, 2024 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timd/d34be1cfee9efb17723cfdd3786291e1 to your computer and use it in GitHub Desktop.
Save timd/d34be1cfee9efb17723cfdd3786291e1 to your computer and use it in GitHub Desktop.
{
"info": {
"name": "Fastmail JMAP",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Fastmail JMAP",
"item": [
{
"name": "Get folders",
"event": [],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "{{fastmailAuth}}",
"disabled": false,
"type": "default"
}
],
"url": "https://api.fastmail.com/jmap/api/",
"body": {
"mode": "raw",
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Mailbox/get\",\n {\n \"accountId\": \"{{accountId}}\",\n \"ids\": null\n },\n \"abc\"\n ]\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "GET account details",
"event": [],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{fastmailAuth}}",
"disabled": false,
"type": "default"
}
],
"url": "https://api.fastmail.com/.well-known/jmap",
"body": {
"mode": "raw",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Get folder contents",
"event": [],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "{{fastmailAuth}}",
"disabled": false,
"type": "default"
}
],
"url": "https://api.fastmail.com/jmap/api/",
"body": {
"mode": "raw",
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/query\",\n {\n \"accountId\": \"{{accountId}}\",\n \"filter\": {\n \"inMailbox\": \"{{mailboxId}}\"\n },\n \"sort\": [\n {\n \"property\": \"receivedAt\",\n \"isAscending\": false\n }\n ],\n \"limit\": 500\n },\n \"a\"\n ]\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Get specific email",
"event": [],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "{{fastmailAuth}}",
"disabled": false,
"type": "default"
}
],
"url": "https://api.fastmail.com/jmap/api/",
"body": {
"mode": "raw",
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/get\",\n {\n \"accountId\": \"{{accountId}}\",\n \"properties\": null,\n \"ids\": [\n \"{{mailId}}\"\n ]\n },\n \"a\"\n ]\n ]\n}\n",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Get email blob",
"event": [],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{fastmailAuth}}",
"disabled": false,
"type": "default"
}
],
"url": "https://www.fastmailusercontent.com/jmap/download/accountID/blobId/name?type=application/html",
"body": {
"mode": "raw",
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/get\",\n {\n \"accountId\": \"{{accountId}}\",\n \"properties\": null,\n \"ids\": [\n \"{{blobId}}\"\n ]\n },\n \"a\"\n ]\n ]\n}\n",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Query specific email",
"event": [],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "{{fastmailAuth}}",
"disabled": false,
"type": "default"
}
],
"url": "https://api.fastmail.com/jmap/api/",
"body": {
"mode": "raw",
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/query\",\n {\n \"accountId\": \"{{accountId}}\",\n \"filter\": {\n \"ids\": [\"{{mailId}}\"]\n },\n \"sort\": [\n {\n \"property\": \"receivedAt\",\n \"isAscending\": false\n }\n ],\n \"limit\": 500\n },\n \"a\"\n ]\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
}
]
}
],
"variable": [
{
"key": "host",
"value": "",
"type": "default"
},
{
"key": "fastmailAuth",
"value": "",
"type": "default"
},
{
"key": "accountId",
"value": "",
"type": "default"
},
{
"key": "emailId",
"value": "",
"type": "default"
},
{
"key": "blobId",
"value": "",
"type": "default"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment