Skip to content

Submission For Topcoder Project Service - Update Invite Endpoints part1 #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 222 additions & 28 deletions docs/Project API.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "2e0a1b99-3cb9-4c77-a562-7e6fe4956358",
"_postman_id": "47adb133-9da4-4cc6-aa73-c7e7a2eb675e",
"name": "Project API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
Expand Down Expand Up @@ -1033,6 +1033,41 @@
{
"name": "Project Members Invites",
"item": [
{
"name": "List project member invite",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/invites",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"invites"
]
}
},
"response": []
},
{
"name": "Create project member with no payload",
"request": {
Expand All @@ -1044,23 +1079,29 @@
},
{
"key": "Content-Type",
"value": "application/json"
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n}"
"raw": "{\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
"raw": "{{api-url}}/projects/{{projectId}}/invites",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"members",
"invite"
"invites"
]
},
"description": "Request payload is mandatory while creating project. If no request payload is specified this should result in 400 status code."
Expand All @@ -1078,29 +1119,128 @@
},
{
"key": "Content-Type",
"value": "application/json"
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"role\": \"customer\",\n\t\"emails\": [\"test@topcoder.com\"]\n}"
"raw": "{\n\t\"role\": \"customer\",\n\t\"emails\": [\"test@topcoder.com\"]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
"raw": "{{api-url}}/projects/{{projectId}}/invites",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"members",
"invite"
"invites"
]
},
"description": "If the request payload is valid, than project customer should be added. This should sync with the direct project is project is associated with direct project."
},
"response": []
},
{
"name": "Create member invites with handles",
"event": [
{
"listen": "test",
"script": {
"id": "3835313a-bb42-487a-b17e-4d687535d7e5",
"exec": [
"pm.test(\"Status code is 201\", function () {",
" pm.response.to.have.status(201);",
" pm.environment.set(\"inviteId\", pm.response.json().success[0].id);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"role\": \"copilot\",\n\t\"handles\": [\"test_copilot1\"]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/invites",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"invites"
]
}
},
"response": []
},
{
"name": "Create member invites with wrong roles",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"role\": \"manager\",\n\t\"handles\": [\"test_copilot1\", \"test_user1\"]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/invites",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"invites"
]
}
},
"response": []
},
{
"name": "Get project member invite",
"protocolProfileBehavior": {
Expand All @@ -1123,15 +1263,15 @@
"raw": ""
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"members",
"invite"
"invites",
"{{inviteId}}"
]
},
"description": "Update a project's member."
Expand All @@ -1141,65 +1281,119 @@
{
"name": "Update project member invite",
"request": {
"method": "PUT",
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
"value": "Bearer {{jwt-token-copilot-40051332}}"
},
{
"key": "Content-Type",
"value": "application/json"
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"status\": \"accepted\",\n\t\"email\": \"test@topcoder.com\"\n}"
"raw": "{\n\t\"status\": \"accepted\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"members",
"invite"
"invites",
"{{inviteId}}"
]
},
"description": "Update a project's member."
},
"response": []
},
{
"name": "wrong status",
"name": "Update project member invite - wrong status",
"request": {
"method": "PUT",
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"value": "application/json"
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": " {\n\t\"status\": \"wrong\"\n } "
"raw": " {\n\t\"status\": \"wrong\"\n } ",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"members",
"invite"
"invites",
"{{inviteId}}"
]
}
},
"response": []
},
{
"name": "Update project member invite - wrong user",
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token-member2-40051335}}"
},
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"status\": \"accepted\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"invites",
"{{inviteId}}"
]
}
},
Expand Down
Loading