Skip to content

Instantly share code, notes, and snippets.

@guillaumeduhan
Created March 24, 2025 10:09
Show Gist options
  • Save guillaumeduhan/e2006d3173597d7f2b9b29c7e85ccd10 to your computer and use it in GitHub Desktop.
Save guillaumeduhan/e2006d3173597d7f2b9b29c7e85ccd10 to your computer and use it in GitHub Desktop.
{
"info": {
"name": "Permit.io Next.js API Testing",
"description": "A collection to test the Permit.io permission check endpoint in Next.js",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Check Permission - GET",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/api/permission",
"host": ["{{baseUrl}}"],
"path": ["api", "permission"]
},
"description": "Test the permission check for user 'codewithg' to create a document"
},
"response": []
},
{
"name": "Check Permission with Auth Header",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{authToken}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/api/permission",
"host": ["{{baseUrl}}"],
"path": ["api", "permission"]
},
"description": "Test with authentication header for a real-world scenario"
},
"response": []
},
{
"name": "Check Permission with Query Parameters",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/api/permission?userId=codewithg&action=create&resource=document",
"host": ["{{baseUrl}}"],
"path": ["api", "permission"],
"query": [
{
"key": "userId",
"value": "codewithg"
},
{
"key": "action",
"value": "create"
},
{
"key": "resource",
"value": "document"
}
]
},
"description": "Test with customizable parameters (requires endpoint modification to use query params)"
},
"response": []
}
],
"event": [],
"variable": [
{
"key": "baseUrl",
"value": "http://localhost:3000",
"type": "string"
},
{
"key": "authToken",
"value": "your_jwt_token_here",
"type": "string"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment