Skip to content

Commit e8268b5

Browse files
committed
Submission For Topcoder Project Service - Update Invite Endpoints - part 1
1 parent 9c4f5ac commit e8268b5

File tree

16 files changed

+1449
-592
lines changed

16 files changed

+1449
-592
lines changed

docs/Project API.postman_collection.json

Lines changed: 222 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info": {
3-
"_postman_id": "2e0a1b99-3cb9-4c77-a562-7e6fe4956358",
3+
"_postman_id": "47adb133-9da4-4cc6-aa73-c7e7a2eb675e",
44
"name": "Project API",
55
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
66
},
@@ -1033,6 +1033,41 @@
10331033
{
10341034
"name": "Project Members Invites",
10351035
"item": [
1036+
{
1037+
"name": "List project member invite",
1038+
"protocolProfileBehavior": {
1039+
"disableBodyPruning": true
1040+
},
1041+
"request": {
1042+
"method": "GET",
1043+
"header": [
1044+
{
1045+
"key": "Authorization",
1046+
"value": "Bearer {{jwt-token}}"
1047+
},
1048+
{
1049+
"key": "Content-Type",
1050+
"value": "application/json"
1051+
}
1052+
],
1053+
"body": {
1054+
"mode": "raw",
1055+
"raw": ""
1056+
},
1057+
"url": {
1058+
"raw": "{{api-url}}/projects/{{projectId}}/invites",
1059+
"host": [
1060+
"{{api-url}}"
1061+
],
1062+
"path": [
1063+
"projects",
1064+
"{{projectId}}",
1065+
"invites"
1066+
]
1067+
}
1068+
},
1069+
"response": []
1070+
},
10361071
{
10371072
"name": "Create project member with no payload",
10381073
"request": {
@@ -1044,23 +1079,29 @@
10441079
},
10451080
{
10461081
"key": "Content-Type",
1047-
"value": "application/json"
1082+
"name": "Content-Type",
1083+
"value": "application/json",
1084+
"type": "text"
10481085
}
10491086
],
10501087
"body": {
10511088
"mode": "raw",
1052-
"raw": "{\n}"
1089+
"raw": "{\n}",
1090+
"options": {
1091+
"raw": {
1092+
"language": "json"
1093+
}
1094+
}
10531095
},
10541096
"url": {
1055-
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
1097+
"raw": "{{api-url}}/projects/{{projectId}}/invites",
10561098
"host": [
10571099
"{{api-url}}"
10581100
],
10591101
"path": [
10601102
"projects",
10611103
"{{projectId}}",
1062-
"members",
1063-
"invite"
1104+
"invites"
10641105
]
10651106
},
10661107
"description": "Request payload is mandatory while creating project. If no request payload is specified this should result in 400 status code."
@@ -1078,29 +1119,128 @@
10781119
},
10791120
{
10801121
"key": "Content-Type",
1081-
"value": "application/json"
1122+
"name": "Content-Type",
1123+
"value": "application/json",
1124+
"type": "text"
10821125
}
10831126
],
10841127
"body": {
10851128
"mode": "raw",
1086-
"raw": "{\n\t\"role\": \"customer\",\n\t\"emails\": [\"test@topcoder.com\"]\n}"
1129+
"raw": "{\n\t\"role\": \"customer\",\n\t\"emails\": [\"test@topcoder.com\"]\n}",
1130+
"options": {
1131+
"raw": {
1132+
"language": "json"
1133+
}
1134+
}
10871135
},
10881136
"url": {
1089-
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
1137+
"raw": "{{api-url}}/projects/{{projectId}}/invites",
10901138
"host": [
10911139
"{{api-url}}"
10921140
],
10931141
"path": [
10941142
"projects",
10951143
"{{projectId}}",
1096-
"members",
1097-
"invite"
1144+
"invites"
10981145
]
10991146
},
11001147
"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."
11011148
},
11021149
"response": []
11031150
},
1151+
{
1152+
"name": "Create member invites with handles",
1153+
"event": [
1154+
{
1155+
"listen": "test",
1156+
"script": {
1157+
"id": "3835313a-bb42-487a-b17e-4d687535d7e5",
1158+
"exec": [
1159+
"pm.test(\"Status code is 201\", function () {",
1160+
" pm.response.to.have.status(201);",
1161+
" pm.environment.set(\"inviteId\", pm.response.json().success[0].id);",
1162+
"});"
1163+
],
1164+
"type": "text/javascript"
1165+
}
1166+
}
1167+
],
1168+
"request": {
1169+
"method": "POST",
1170+
"header": [
1171+
{
1172+
"key": "Authorization",
1173+
"value": "Bearer {{jwt-token}}"
1174+
},
1175+
{
1176+
"key": "Content-Type",
1177+
"name": "Content-Type",
1178+
"value": "application/json",
1179+
"type": "text"
1180+
}
1181+
],
1182+
"body": {
1183+
"mode": "raw",
1184+
"raw": "{\n\t\"role\": \"copilot\",\n\t\"handles\": [\"test_copilot1\"]\n}",
1185+
"options": {
1186+
"raw": {
1187+
"language": "json"
1188+
}
1189+
}
1190+
},
1191+
"url": {
1192+
"raw": "{{api-url}}/projects/{{projectId}}/invites",
1193+
"host": [
1194+
"{{api-url}}"
1195+
],
1196+
"path": [
1197+
"projects",
1198+
"{{projectId}}",
1199+
"invites"
1200+
]
1201+
}
1202+
},
1203+
"response": []
1204+
},
1205+
{
1206+
"name": "Create member invites with wrong roles",
1207+
"request": {
1208+
"method": "POST",
1209+
"header": [
1210+
{
1211+
"key": "Authorization",
1212+
"value": "Bearer {{jwt-token}}"
1213+
},
1214+
{
1215+
"key": "Content-Type",
1216+
"name": "Content-Type",
1217+
"value": "application/json",
1218+
"type": "text"
1219+
}
1220+
],
1221+
"body": {
1222+
"mode": "raw",
1223+
"raw": "{\n\t\"role\": \"manager\",\n\t\"handles\": [\"test_copilot1\", \"test_user1\"]\n}",
1224+
"options": {
1225+
"raw": {
1226+
"language": "json"
1227+
}
1228+
}
1229+
},
1230+
"url": {
1231+
"raw": "{{api-url}}/projects/{{projectId}}/invites",
1232+
"host": [
1233+
"{{api-url}}"
1234+
],
1235+
"path": [
1236+
"projects",
1237+
"{{projectId}}",
1238+
"invites"
1239+
]
1240+
}
1241+
},
1242+
"response": []
1243+
},
11041244
{
11051245
"name": "Get project member invite",
11061246
"protocolProfileBehavior": {
@@ -1123,15 +1263,15 @@
11231263
"raw": ""
11241264
},
11251265
"url": {
1126-
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
1266+
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
11271267
"host": [
11281268
"{{api-url}}"
11291269
],
11301270
"path": [
11311271
"projects",
11321272
"{{projectId}}",
1133-
"members",
1134-
"invite"
1273+
"invites",
1274+
"{{inviteId}}"
11351275
]
11361276
},
11371277
"description": "Update a project's member."
@@ -1141,65 +1281,119 @@
11411281
{
11421282
"name": "Update project member invite",
11431283
"request": {
1144-
"method": "PUT",
1284+
"method": "PATCH",
11451285
"header": [
11461286
{
11471287
"key": "Authorization",
1148-
"value": "Bearer {{jwt-token}}"
1288+
"value": "Bearer {{jwt-token-copilot-40051332}}"
11491289
},
11501290
{
11511291
"key": "Content-Type",
1152-
"value": "application/json"
1292+
"name": "Content-Type",
1293+
"value": "application/json",
1294+
"type": "text"
11531295
}
11541296
],
11551297
"body": {
11561298
"mode": "raw",
1157-
"raw": "{\n\t\"status\": \"accepted\",\n\t\"email\": \"test@topcoder.com\"\n}"
1299+
"raw": "{\n\t\"status\": \"accepted\"\n}",
1300+
"options": {
1301+
"raw": {
1302+
"language": "json"
1303+
}
1304+
}
11581305
},
11591306
"url": {
1160-
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
1307+
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
11611308
"host": [
11621309
"{{api-url}}"
11631310
],
11641311
"path": [
11651312
"projects",
11661313
"{{projectId}}",
1167-
"members",
1168-
"invite"
1314+
"invites",
1315+
"{{inviteId}}"
11691316
]
11701317
},
11711318
"description": "Update a project's member."
11721319
},
11731320
"response": []
11741321
},
11751322
{
1176-
"name": "wrong status",
1323+
"name": "Update project member invite - wrong status",
11771324
"request": {
1178-
"method": "PUT",
1325+
"method": "PATCH",
11791326
"header": [
11801327
{
11811328
"key": "Authorization",
11821329
"value": "Bearer {{jwt-token}}"
11831330
},
11841331
{
11851332
"key": "Content-Type",
1186-
"value": "application/json"
1333+
"name": "Content-Type",
1334+
"value": "application/json",
1335+
"type": "text"
11871336
}
11881337
],
11891338
"body": {
11901339
"mode": "raw",
1191-
"raw": " {\n\t\"status\": \"wrong\"\n } "
1340+
"raw": " {\n\t\"status\": \"wrong\"\n } ",
1341+
"options": {
1342+
"raw": {
1343+
"language": "json"
1344+
}
1345+
}
11921346
},
11931347
"url": {
1194-
"raw": "{{api-url}}/projects/{{projectId}}/members/invite",
1348+
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
11951349
"host": [
11961350
"{{api-url}}"
11971351
],
11981352
"path": [
11991353
"projects",
12001354
"{{projectId}}",
1201-
"members",
1202-
"invite"
1355+
"invites",
1356+
"{{inviteId}}"
1357+
]
1358+
}
1359+
},
1360+
"response": []
1361+
},
1362+
{
1363+
"name": "Update project member invite - wrong user",
1364+
"request": {
1365+
"method": "PATCH",
1366+
"header": [
1367+
{
1368+
"key": "Authorization",
1369+
"value": "Bearer {{jwt-token-member2-40051335}}"
1370+
},
1371+
{
1372+
"key": "Content-Type",
1373+
"name": "Content-Type",
1374+
"value": "application/json",
1375+
"type": "text"
1376+
}
1377+
],
1378+
"body": {
1379+
"mode": "raw",
1380+
"raw": "{\n\t\"status\": \"accepted\"\n}",
1381+
"options": {
1382+
"raw": {
1383+
"language": "json"
1384+
}
1385+
}
1386+
},
1387+
"url": {
1388+
"raw": "{{api-url}}/projects/{{projectId}}/invites/{{inviteId}}",
1389+
"host": [
1390+
"{{api-url}}"
1391+
],
1392+
"path": [
1393+
"projects",
1394+
"{{projectId}}",
1395+
"invites",
1396+
"{{inviteId}}"
12031397
]
12041398
}
12051399
},

0 commit comments

Comments
 (0)