Skip to content

Instantly share code, notes, and snippets.

@amattu2
Created February 11, 2023 15:39
Show Gist options
  • Save amattu2/2c13af1b84dcf7f5ead66d6d29ec86b2 to your computer and use it in GitHub Desktop.
Save amattu2/2c13af1b84dcf7f5ead66d6d29ec86b2 to your computer and use it in GitHub Desktop.
This is a WIP Postman and ThunderClient request repository for interacting with the TryFi.com (api.tryfi.com) pet collar API.
{
"info": {
"name": "TryFi",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"description": ""
},
"item": [
{
"name": "Auth",
"item": [
{
"name": "Login",
"request": {
"method": "POST",
"url": {
"raw": "auth/login",
"path": [
"login"
],
"host": [
"auth"
]
},
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"disabled": true
}
],
"body": {
"mode": "raw",
"options": {
"raw": {
"language": "json"
}
},
"raw": "{\n \"email\": \"{{email}}\",\n \"password\": \"{{password}}\"\n}"
}
}
},
{
"name": "Check Email",
"request": {
"method": "GET",
"url": {
"raw": "auth/checkemail?email={{email}}",
"query": [
{
"key": "email",
"value": "{{email}}"
}
],
"variable": [],
"path": [
"checkemail"
],
"host": [
"auth"
]
},
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "X-Api-Key",
"value": "{{fiApiKey}}"
},
{
"key": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"disabled": true
}
]
}
},
{
"name": "Register",
"request": {
"method": "POST",
"url": {
"raw": "auth/signup",
"path": [
"signup"
],
"host": [
"auth"
]
},
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "X-API-Key",
"value": "{{fiApiKey}}"
},
{
"key": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"disabled": true
}
],
"body": {
"mode": "raw",
"options": {
"raw": {
"language": "json"
}
},
"raw": "{\n \"firstName\": \"Example\",\n \"lastName\": \"Example\",\n \"email\": \"{{email}}\",\n \"password\": \"{{password}}\"\n}"
}
}
},
{
"name": "Password Reset",
"request": {
"method": "POST",
"url": {
"raw": "auth/sendpasswordreset",
"path": [
"sendpasswordreset"
],
"host": [
"auth"
]
},
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "X-API-Key",
"value": "{{fiApiKey}}"
},
{
"key": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"disabled": true
}
],
"body": {
"mode": "raw",
"options": {
"raw": {
"language": "json"
}
},
"raw": "{\n \"email\": \"{{email}}\"\n}"
}
}
}
]
},
{
"name": "Queries",
"item": [
{
"name": "Pets",
"item": [
{
"name": "All Breeds",
"request": {
"method": "POST",
"url": {
"raw": "graphql",
"host": [
"graphql"
]
},
"body": {
"mode": "graphql",
"graphql": {
"query": "{\n allBreeds {\n __typename\n id\n name\n popularityScore\n }\n}"
}
}
}
},
{
"name": "All User Pets",
"request": {
"method": "POST",
"url": {
"raw": "graphql",
"host": [
"graphql"
]
},
"body": {
"mode": "graphql",
"graphql": {
"query": "{\n currentUser {\n id\n userHouseholds {\n householdRole\n household {\n id\n pets {\n id\n name\n device {\n id\n }\n }\n }\n }\n }\n}\n"
}
}
}
}
]
},
{
"name": "User",
"item": [
{
"name": "currentUser",
"request": {
"method": "POST",
"url": {
"raw": "graphql",
"host": [
"graphql"
]
},
"body": {
"mode": "graphql",
"graphql": {
"query": "{\n currentUser {\n __typename\n id\n email\n firstName\n lastName\n phoneNumber\n fiNewsNotificationsEnabled\n chipReseller {\n __typename\n id\n }\n }\n}"
}
}
}
}
]
}
]
},
{
"name": "Mutations",
"item": []
}
]
}
[
{
"_id": "e5630a34-ee6a-4cbd-b00a-901c6a37505f",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"containerId": "66aba99e-ce2a-40b1-8afb-ad31ca3e79c1",
"name": "Login",
"url": "auth/login",
"method": "POST",
"sortNum": 10000,
"created": "2023-02-11T13:59:24.541Z",
"modified": "2023-02-11T14:04:02.333Z",
"headers": [
{
"name": "Accept",
"value": "application/json"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"isDisabled": true
}
],
"params": [],
"body": {
"type": "json",
"raw": "{\n \"email\": \"{{email}}\",\n \"password\": \"{{password}}\"\n}",
"form": []
},
"tests": [
{
"type": "res-code",
"custom": "",
"action": "equal",
"value": "200"
},
{
"type": "set-env-var",
"custom": "json.userId",
"action": "setto",
"value": "{{userId}}"
},
{
"type": "set-env-var",
"custom": "json.sessionId",
"action": "setto",
"value": "{{sessionId}}"
},
{
"type": "json-query",
"custom": "json.userId",
"action": "istype",
"value": "string"
},
{
"type": "json-query",
"custom": "json.sessionId",
"action": "istype",
"value": "string"
}
]
},
{
"_id": "e46d02fd-05fd-4286-92c8-7e096309c5f8",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"containerId": "20e1837c-4943-4dfd-a692-490d1ca73c33",
"name": "currentUser",
"url": "graphql",
"method": "POST",
"sortNum": 30000,
"created": "2023-02-11T14:08:33.043Z",
"modified": "2023-02-11T14:48:41.746Z",
"headers": [],
"params": [],
"body": {
"type": "graphql",
"raw": "",
"form": [],
"graphql": {
"query": "{\n currentUser {\n __typename\n id\n email\n firstName\n lastName\n phoneNumber\n fiNewsNotificationsEnabled\n chipReseller {\n __typename\n id\n }\n }\n}"
}
},
"tests": []
},
{
"_id": "2eb50703-1638-4499-a585-16d08330176b",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"containerId": "66aba99e-ce2a-40b1-8afb-ad31ca3e79c1",
"name": "Check Email",
"url": "auth/checkemail?email={{email}}",
"method": "GET",
"sortNum": 15000,
"created": "2023-02-11T14:15:36.694Z",
"modified": "2023-02-11T14:22:22.177Z",
"headers": [
{
"name": "Accept",
"value": "application/json"
},
{
"name": "X-Api-Key",
"value": "{{fiApiKey}}"
},
{
"name": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"isDisabled": true
}
],
"params": [
{
"name": "email",
"value": "{{email}}",
"isPath": false
}
],
"tests": [
{
"type": "res-code",
"custom": "",
"action": "equal",
"value": "200"
},
{
"type": "json-query",
"custom": "json.exists",
"action": "istype",
"value": "boolean"
}
]
},
{
"_id": "4ae99624-adc7-490c-afd2-4fdd99ec04f0",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"containerId": "66aba99e-ce2a-40b1-8afb-ad31ca3e79c1",
"name": "Register",
"url": "auth/signup",
"method": "POST",
"sortNum": 17500,
"created": "2023-02-11T14:18:44.487Z",
"modified": "2023-02-11T14:25:47.627Z",
"headers": [
{
"name": "Accept",
"value": "application/json"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "X-API-Key",
"value": "{{fiApiKey}}"
},
{
"name": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"isDisabled": true
}
],
"params": [],
"body": {
"type": "json",
"raw": "{\n \"firstName\": \"Example\",\n \"lastName\": \"Example\",\n \"email\": \"{{email}}\",\n \"password\": \"{{password}}\"\n}",
"form": []
},
"tests": [
{
"type": "res-code",
"custom": "",
"action": "equal",
"value": "200"
},
{
"type": "json-query",
"custom": "json.sessionId",
"action": "istype",
"value": "string"
},
{
"type": "json-query",
"custom": "json.userId",
"action": "istype",
"value": "string"
},
{
"type": "set-env-var",
"custom": "json.sessionId",
"action": "setto",
"value": "{{sessionId}}"
},
{
"type": "set-env-var",
"custom": "json.userId",
"action": "setto",
"value": "{{userId}}"
}
]
},
{
"_id": "445a26a1-e0a2-4e1e-92c6-8716cfa22a78",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"containerId": "66aba99e-ce2a-40b1-8afb-ad31ca3e79c1",
"name": "Password Reset",
"url": "auth/sendpasswordreset",
"method": "POST",
"sortNum": 27500,
"created": "2023-02-11T14:26:28.406Z",
"modified": "2023-02-11T14:27:21.386Z",
"headers": [
{
"name": "Accept",
"value": "application/json"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "X-API-Key",
"value": "{{fiApiKey}}"
},
{
"name": "User-Agent",
"value": "Thunder Client (https://www.thunderclient.com)",
"isDisabled": true
}
],
"params": [],
"body": {
"type": "json",
"raw": "{\n \"email\": \"{{email}}\"\n}",
"form": []
},
"tests": [
{
"type": "res-code",
"custom": "",
"action": "equal",
"value": "200"
}
]
},
{
"_id": "35339d2b-0323-48b8-90a7-5083bf608484",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"containerId": "0e02a6e2-6b9c-43a7-8bfc-5bb6a1a9a586",
"name": "All Breeds",
"url": "graphql",
"method": "POST",
"sortNum": 40000,
"created": "2023-02-11T14:56:04.007Z",
"modified": "2023-02-11T14:57:55.417Z",
"headers": [],
"params": [],
"body": {
"type": "graphql",
"raw": "",
"form": [],
"graphql": {
"query": "{\n allBreeds {\n __typename\n id\n name\n popularityScore\n }\n}"
}
},
"tests": [
{
"type": "res-code",
"custom": "",
"action": "equal",
"value": "200"
},
{
"type": "Content-Type",
"custom": "",
"action": "contains",
"value": "application/json"
}
]
},
{
"_id": "b9b1fc96-7953-4c32-93ca-db68c38507f3",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"containerId": "0e02a6e2-6b9c-43a7-8bfc-5bb6a1a9a586",
"name": "All User Pets",
"url": "graphql",
"method": "POST",
"sortNum": 50000,
"created": "2023-02-11T15:01:17.505Z",
"modified": "2023-02-11T15:02:43.842Z",
"headers": [],
"params": [],
"body": {
"type": "graphql",
"raw": "",
"form": [],
"graphql": {
"query": "{\n currentUser {\n id\n userHouseholds {\n householdRole\n household {\n id\n pets {\n id\n name\n device {\n id\n }\n }\n }\n }\n }\n}\n"
}
},
"tests": [
{
"type": "res-code",
"custom": "",
"action": "equal",
"value": "200"
},
{
"type": "Content-Type",
"custom": "",
"action": "contains",
"value": "application/json"
}
]
}
]
[
{
"_id": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"colName": "TryFi",
"created": "2023-02-11T13:59:10.902Z",
"sortNum": 10000,
"folders": [
{
"_id": "66aba99e-ce2a-40b1-8afb-ad31ca3e79c1",
"name": "Auth",
"containerId": "",
"created": "2023-02-11T13:59:17.190Z",
"sortNum": 10000
},
{
"_id": "20e1837c-4943-4dfd-a692-490d1ca73c33",
"name": "User",
"containerId": "37265d11-fa54-40ff-94cd-00e1e1a96507",
"created": "2023-02-11T14:06:49.451Z",
"sortNum": 20000,
"settings": {
"headers": [
{
"name": "X-Session-Id",
"value": "{{sessionId}}"
},
{
"name": "Accept",
"value": "application/json"
}
],
"tests": [],
"preReq": {
"runRequests": [
{
"reqId": "e5630a34-ee6a-4cbd-b00a-901c6a37505f",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"triggerCondition": "run-var-empty",
"triggerValue": "{{sessionId}}"
}
]
}
}
},
{
"_id": "0e02a6e2-6b9c-43a7-8bfc-5bb6a1a9a586",
"name": "Pets",
"containerId": "37265d11-fa54-40ff-94cd-00e1e1a96507",
"created": "2023-02-11T14:56:04.006Z",
"sortNum": 10000,
"settings": {
"headers": [
{
"name": "X-Session-Id",
"value": "{{sessionId}}"
},
{
"name": "Accept",
"value": "application/json"
}
],
"tests": [],
"preReq": {
"runRequests": [
{
"reqId": "e5630a34-ee6a-4cbd-b00a-901c6a37505f",
"colId": "db62ec5c-d4ba-4cf5-a9ca-d8ba8c7ba085",
"triggerCondition": "run-var-empty",
"triggerValue": "{{sessionId}}"
}
]
}
}
},
{
"_id": "37265d11-fa54-40ff-94cd-00e1e1a96507",
"name": "Queries",
"containerId": "",
"created": "2023-02-11T15:34:51.871Z",
"sortNum": 30000
},
{
"_id": "a5788ca9-fd22-4f95-97e6-85bc264c5346",
"name": "Mutations",
"containerId": "",
"created": "2023-02-11T15:35:05.859Z",
"sortNum": 40000
}
],
"settings": {
"headers": [],
"tests": [],
"options": {
"baseUrl": "https://api.tryfi.com/"
}
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment