add api usage examples

This commit is contained in:
xfarrow 2024-10-28 16:42:55 +01:00
parent a1185ed0db
commit 18eec7bf66
2 changed files with 358 additions and 368 deletions

View File

@ -77,16 +77,16 @@
}, },
{ {
"type": "http", "type": "http",
"name": "CreateApplication", "name": "ChangeApplicationStatus",
"seq": 4, "seq": 1,
"request": { "request": {
"url": "http://localhost:3000/api/applications", "url": "http://localhost:3000/api/organizations/joboffers/applications/2",
"method": "POST", "method": "PATCH",
"headers": [], "headers": [],
"params": [], "params": [],
"body": { "body": {
"mode": "json", "mode": "json",
"json": "{\n \"jobOfferId\": 1\n}", "json": "{\n \"status\": \"ACCEPTED\"\n}",
"formUrlEncoded": [], "formUrlEncoded": [],
"multipartForm": [] "multipartForm": []
}, },
@ -97,7 +97,33 @@
"auth": { "auth": {
"mode": "bearer", "mode": "bearer",
"bearer": { "bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTcyOTc3NDc4NywiZXhwIjoxNzI5ODAzNTg3fQ.Li0NeQH6e4ykQ8tpY3KYkS_bQhv7cIFmjz96U-E9S0c" "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTczMDEyNTUzNywiZXhwIjoxNzMwMTU0MzM3fQ.X216UkLuDL6-Qs6EUbIRL_YKQKKcxyzQFmAKzJNWEzI"
}
}
}
},
{
"type": "http",
"name": "CreateApplication",
"seq": 4,
"request": {
"url": "http://localhost:3000/api/organizations/joboffers/1",
"method": "POST",
"headers": [],
"params": [],
"body": {
"mode": "none",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTczMDEyNTUzNywiZXhwIjoxNzMwMTU0MzM3fQ.X216UkLuDL6-Qs6EUbIRL_YKQKKcxyzQFmAKzJNWEzI"
} }
} }
} }
@ -178,6 +204,33 @@
} }
} }
}, },
{
"type": "http",
"name": "DeleteApplication",
"seq": 2,
"request": {
"url": "http://localhost:3000/api/organizations/joboffers/applications/2",
"method": "DELETE",
"headers": [],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"jobApplicationId\": 1\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTczMDEyODc2NSwiZXhwIjoxNzMwMTU3NTY1fQ.puQ4gw9K_fL4FhXs7UlvyZwq98XZEIuXwnZ0JBIXzaw"
}
}
}
},
{ {
"type": "http", "type": "http",
"name": "DeleteJobOffer", "name": "DeleteJobOffer",
@ -309,6 +362,33 @@
} }
} }
}, },
{
"type": "http",
"name": "GetApplicantsByOrganization",
"seq": 3,
"request": {
"url": "http://localhost:3000/api/organizations/1",
"method": "GET",
"headers": [],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"organizationId\": 1\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTczMDEyNTUzNywiZXhwIjoxNzMwMTU0MzM3fQ.X216UkLuDL6-Qs6EUbIRL_YKQKKcxyzQFmAKzJNWEzI"
}
}
}
},
{ {
"type": "http", "type": "http",
"name": "GetJobOffers", "name": "GetJobOffers",
@ -338,6 +418,32 @@
} }
} }
}, },
{
"type": "http",
"name": "GetMyApplications",
"seq": 5,
"request": {
"url": "http://localhost:3000/api/organizations/applications/mine",
"method": "GET",
"headers": [],
"params": [],
"body": {
"mode": "none",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTczMDEyNTUzNywiZXhwIjoxNzMwMTU0MzM3fQ.X216UkLuDL6-Qs6EUbIRL_YKQKKcxyzQFmAKzJNWEzI"
}
}
}
},
{ {
"type": "http", "type": "http",
"name": "GetMyself", "name": "GetMyself",
@ -463,44 +569,6 @@
} }
} }
}, },
{
"type": "http",
"name": "Register",
"seq": 24,
"request": {
"url": "http://localhost:3000/api/persons",
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "application/json",
"enabled": true
},
{
"name": "User-Agent",
"value": "insomnia/2023.5.8",
"enabled": true
}
],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"email\" : \"john@mail.org\",\n \"password\" : \"password\",\n \"displayName\" : \"John Doe\",\n \"aboutMe\" : \"I am a passionate software engineer\",\n \"qualification\" : \"Software Engineer\"\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": ""
}
}
}
},
{ {
"type": "http", "type": "http",
"name": "RemoveOrganizationAdmin", "name": "RemoveOrganizationAdmin",
@ -539,6 +607,44 @@
} }
} }
}, },
{
"type": "http",
"name": "Register",
"seq": 24,
"request": {
"url": "http://localhost:3000/api/persons",
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "application/json",
"enabled": true
},
{
"name": "User-Agent",
"value": "insomnia/2023.5.8",
"enabled": true
}
],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"email\" : \"john@mail.org\",\n \"password\" : \"password\",\n \"displayName\" : \"John Doe\",\n \"aboutMe\" : \"I am a passionate software engineer\",\n \"qualification\" : \"Software Engineer\"\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": ""
}
}
}
},
{ {
"type": "http", "type": "http",
"name": "RequestNewPassword", "name": "RequestNewPassword",
@ -574,41 +680,6 @@
} }
} }
}, },
{
"type": "http",
"name": "ResetNewPassword",
"seq": 16,
"request": {
"url": "http://localhost:3000/api/resetpassword/reset",
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "application/json",
"enabled": true
},
{
"name": "User-Agent",
"value": "insomnia/2023.5.8",
"enabled": true
}
],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"secret\": \"360837853e2d3cf799c709b44720b4e3\",\n \"password\": \"password\"\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "none"
}
}
},
{ {
"type": "http", "type": "http",
"name": "UpdateOrganization", "name": "UpdateOrganization",
@ -647,6 +718,41 @@
} }
} }
}, },
{
"type": "http",
"name": "ResetNewPassword",
"seq": 16,
"request": {
"url": "http://localhost:3000/api/resetpassword/reset",
"method": "POST",
"headers": [
{
"name": "Content-Type",
"value": "application/json",
"enabled": true
},
{
"name": "User-Agent",
"value": "insomnia/2023.5.8",
"enabled": true
}
],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"secret\": \"360837853e2d3cf799c709b44720b4e3\",\n \"password\": \"password\"\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "none"
}
}
},
{ {
"type": "http", "type": "http",
"name": "UpdatePerson", "name": "UpdatePerson",
@ -684,113 +790,6 @@
} }
} }
} }
},
{
"type": "http",
"name": "GetMyApplications",
"seq": 5,
"request": {
"url": "http://localhost:3000/api/applications/myapplications",
"method": "GET",
"headers": [],
"params": [],
"body": {
"mode": "none",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTcyOTc3NDc4NywiZXhwIjoxNzI5ODAzNTg3fQ.Li0NeQH6e4ykQ8tpY3KYkS_bQhv7cIFmjz96U-E9S0c"
}
}
}
},
{
"type": "http",
"name": "DeleteApplication",
"seq": 2,
"request": {
"url": "http://localhost:3000/api/applications",
"method": "DELETE",
"headers": [],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"jobApplicationId\": 1\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTcyOTc1NTMyNCwiZXhwIjoxNzI5Nzg0MTI0fQ.U2leC3wu51iSOeItTk02TZCDttTYBWBcLahCdoXiIR8"
}
}
}
},
{
"type": "http",
"name": "GetApplicantsByOrganization",
"seq": 3,
"request": {
"url": "http://localhost:3000/api/applications/applicantsbyorganization",
"method": "GET",
"headers": [],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"organizationId\": 1\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTcyOTc3NDc4NywiZXhwIjoxNzI5ODAzNTg3fQ.Li0NeQH6e4ykQ8tpY3KYkS_bQhv7cIFmjz96U-E9S0c"
}
}
}
},
{
"type": "http",
"name": "ChangeApplicationStatus",
"seq": 1,
"request": {
"url": "http://localhost:3000/api/applications",
"method": "POST",
"headers": [],
"params": [],
"body": {
"mode": "json",
"json": "{\n \"jobOfferId\": 1\n}",
"formUrlEncoded": [],
"multipartForm": []
},
"script": {},
"vars": {},
"assertions": [],
"tests": "",
"auth": {
"mode": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTcyOTc3NDc4NywiZXhwIjoxNzI5ODAzNTg3fQ.Li0NeQH6e4ykQ8tpY3KYkS_bQhv7cIFmjz96U-E9S0c"
}
}
}
} }
], ],
"environments": [], "environments": [],

View File

@ -89,14 +89,14 @@
"event": [] "event": []
}, },
{ {
"name": "CreateApplication", "name": "ChangeApplicationStatus",
"event": [], "event": [],
"request": { "request": {
"method": "POST", "method": "PATCH",
"header": [], "header": [],
"description": "", "description": "",
"url": { "url": {
"raw": "http://localhost:3000/api/applications", "raw": "http://localhost:3000/api/organizations/joboffers/applications/2",
"host": [ "host": [
"localhost" "localhost"
], ],
@ -106,7 +106,7 @@
}, },
"body": { "body": {
"mode": "raw", "mode": "raw",
"raw": "{\n \"jobOfferId\": 1\n}", "raw": "{\n \"status\": \"ACCEPTED\"\n}",
"options": { "options": {
"raw": { "raw": {
"language": "json" "language": "json"
@ -115,6 +115,24 @@
} }
} }
}, },
{
"name": "CreateApplication",
"event": [],
"request": {
"method": "POST",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/organizations/joboffers/1",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
}
}
},
{ {
"name": "CreateJobOffer", "name": "CreateJobOffer",
"event": [], "event": [],
@ -195,6 +213,33 @@
} }
} }
}, },
{
"name": "DeleteApplication",
"event": [],
"request": {
"method": "DELETE",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/organizations/joboffers/applications/2",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"raw": "{\n \"jobApplicationId\": 1\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{ {
"name": "DeleteJobOffer", "name": "DeleteJobOffer",
"event": [], "event": [],
@ -310,6 +355,33 @@
} }
} }
}, },
{
"name": "GetApplicantsByOrganization",
"event": [],
"request": {
"method": "GET",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/organizations/1",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"raw": "{\n \"organizationId\": 1\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{ {
"name": "GetJobOffers", "name": "GetJobOffers",
"event": [], "event": [],
@ -335,6 +407,24 @@
} }
} }
}, },
{
"name": "GetMyApplications",
"event": [],
"request": {
"method": "GET",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/organizations/applications/mine",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
}
}
},
{ {
"name": "GetMyself", "name": "GetMyself",
"event": [], "event": [],
@ -450,6 +540,45 @@
} }
} }
}, },
{
"name": "RemoveOrganizationAdmin",
"event": [],
"request": {
"method": "DELETE",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"disabled": false,
"type": "default"
},
{
"key": "User-Agent",
"value": "insomnia/2023.5.8",
"disabled": false,
"type": "default"
}
],
"description": "",
"url": {
"raw": "http://localhost:3000/api/organizations/1/admins/me",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{ {
"name": "Register", "name": "Register",
"event": [], "event": [],
@ -490,45 +619,6 @@
} }
} }
}, },
{
"name": "RemoveOrganizationAdmin",
"event": [],
"request": {
"method": "DELETE",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"disabled": false,
"type": "default"
},
{
"key": "User-Agent",
"value": "insomnia/2023.5.8",
"disabled": false,
"type": "default"
}
],
"description": "",
"url": {
"raw": "http://localhost:3000/api/organizations/1/admins/me",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{ {
"name": "RequestNewPassword", "name": "RequestNewPassword",
"event": [], "event": [],
@ -569,46 +659,6 @@
} }
} }
}, },
{
"name": "ResetNewPassword",
"event": [],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"disabled": false,
"type": "default"
},
{
"key": "User-Agent",
"value": "insomnia/2023.5.8",
"disabled": false,
"type": "default"
}
],
"description": "",
"url": {
"raw": "http://localhost:3000/api/resetpassword/reset",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"raw": "{\n \"secret\": \"360837853e2d3cf799c709b44720b4e3\",\n \"password\": \"password\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{ {
"name": "UpdateOrganization", "name": "UpdateOrganization",
"event": [], "event": [],
@ -649,6 +699,46 @@
} }
} }
}, },
{
"name": "ResetNewPassword",
"event": [],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"disabled": false,
"type": "default"
},
{
"key": "User-Agent",
"value": "insomnia/2023.5.8",
"disabled": false,
"type": "default"
}
],
"description": "",
"url": {
"raw": "http://localhost:3000/api/resetpassword/reset",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"raw": "{\n \"secret\": \"360837853e2d3cf799c709b44720b4e3\",\n \"password\": \"password\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{ {
"name": "UpdatePerson", "name": "UpdatePerson",
"event": [], "event": [],
@ -688,105 +778,6 @@
} }
} }
} }
},
{
"name": "GetMyApplications",
"event": [],
"request": {
"method": "GET",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/applications/myapplications",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
}
}
},
{
"name": "DeleteApplication",
"event": [],
"request": {
"method": "DELETE",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/applications",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"raw": "{\n \"jobApplicationId\": 1\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "GetApplicantsByOrganization",
"event": [],
"request": {
"method": "GET",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/applications/applicantsbyorganization",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"raw": "{\n \"organizationId\": 1\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "ChangeApplicationStatus",
"event": [],
"request": {
"method": "POST",
"header": [],
"description": "",
"url": {
"raw": "http://localhost:3000/api/applications",
"host": [
"localhost"
],
"path": [],
"query": [],
"variable": []
},
"body": {
"mode": "raw",
"raw": "{\n \"jobOfferId\": 1\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
} }
], ],
"variable": [] "variable": []