{
  "info": {
    "_postman_id": "b067669a-5d6e-43f6-aede-a498c4fb6ccd",
    "name": "WINDA API V4",
    "description": "# WINDA API V4 - Postman Collection\n\nThis collection describes WINDA API V4 and its various endpoints.\n\nFor a detailed view of all WINDA API endpoints, please take a look at [WINDA API Documentation](https://www.globalwindsafety.org/winda/winda-api) on our webside. The documentation on our webside should be considered the master documentation.\n\n#### Collection Variables\n\nPlease fill out the collection variables, as it will fill out the variables in the URLs.\n\n↓To view the in-Postman documentation, please view the \"complete documentaiton\" down below.↓",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "44046963",
    "_collection_link": "https://go.postman.co/collection/44046963-b067669a-5d6e-43f6-aede-a498c4fb6ccd?source=collection_link"
  },
  "item": [
    {
      "name": "Access Token Objects",
      "item": [
        {
          "name": "CreateAccessToken",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "username",
                  "value": "",
                  "type": "text",
                  "uuid": "f301763e-0240-41f0-9129-08d89c395509"
                },
                {
                  "key": "password",
                  "value": "",
                  "type": "text",
                  "uuid": "754b1d2b-bca7-4d62-b6ab-447718442475"
                }
              ]
            },
            "url": {
              "raw": "{{accessTokenURL}}/access/get-token",
              "host": [
                "{{accessTokenURL}}"
              ],
              "path": [
                "access",
                "get-token"
              ]
            },
            "description": "Endpoint used to **create an access token**, critical for any further API usage."
          },
          "response": []
        },
        {
          "name": "CreateRefreshToken",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "refresh_token",
                  "value": "",
                  "type": "text",
                  "uuid": "ce5bd754-df76-48ef-8cab-4b83402811ae"
                }
              ]
            },
            "url": {
              "raw": "{{accessTokenURL}}/access/refresh-token",
              "host": [
                "{{accessTokenURL}}"
              ],
              "path": [
                "access",
                "refresh-token"
              ]
            },
            "description": "Endpoint used to **create an access token**, critical for _prolonged_ API usage."
          },
          "response": []
        }
      ],
      "description": "### Description\n\nThese endpoints are used to obtain access to the WINDA API V4. Access is granted through access tokens, which act as authorization for all WINDA API endpoints except for `/access/get-token` and `/access/refresh-token`, which are used to generate and renew those tokens.\n\nEach access token created, whether through `/access/get-token` or `/access/refresh-token,`is valid only for the time specified in the `expires_in` field. Once it expires, it becomes invalid. At that point, you must use the refresh token from the previous access token response to request a new access token via `/access/refresh-token`. This call returns a fresh access token along with a new refresh token."
    },
    {
      "name": "Information Objects",
      "item": [
        {
          "name": "CreateUpload",
          "protocolProfileBehavior": {
            "protocolVersion": "http1"
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "description",
                  "value": "",
                  "type": "text",
                  "uuid": "26b1c062-a7a9-436d-8479-b42a89739202"
                },
                {
                  "key": "file",
                  "type": "file",
                  "uuid": "2341e79b-59fb-46e9-820d-c013fe63aaad",
                  "value": null
                }
              ]
            },
            "url": {
              "raw": "{{baseURL}}/training-provider/v1/{{tpID}}/uploads",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "v1",
                "{{tpID}}",
                "uploads"
              ]
            },
            "description": "This endpoint is used to _create_ an _Upload draft_ in WINDA."
          },
          "response": []
        },
        {
          "name": "PurchaseUpload",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseURL}}/training-provider/{{tpID}}/uploads/{{uploadID}}/purchase",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "{{tpID}}",
                "uploads",
                "{{uploadID}}",
                "purchase"
              ]
            },
            "description": "This endpoint is used to _purchase_ valid Upload drafts in WINDA.\n\nIt is only possible to purchase valid (error-free) Uploads. If unable to purchase because of errors in the Upload, please use `/training-provider//uploads//download`."
          },
          "response": []
        },
        {
          "name": "DownloadUploadErrorLog",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseURL}}/training-provider/{{tpID}}/uploads/{{uploadID}}/download",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "{{tpID}}",
                "uploads",
                "{{uploadID}}",
                "download"
              ]
            },
            "description": "This endpoint is used to _get_ a speicific Upload's error log."
          },
          "response": []
        },
        {
          "name": "DeleteUpload",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseURL}}/training-provider/{{tpID}}/uploads/{{uploadID}}/discard",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "{{tpID}}",
                "uploads",
                "{{uploadID}}",
                "discard"
              ]
            },
            "description": "This endpoint is used to _delete_ Upload drafts.\n\nOnly Uploads which have not been purchased can be deleted, i.e. Upload drafts."
          },
          "response": []
        },
        {
          "name": "GetUploads",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseURL}}/training-provider/{{tpID}}/uploads",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "{{tpID}}",
                "uploads"
              ]
            },
            "description": "This endpoint is used to _get_ all the Uploads from the specified training provider."
          },
          "response": []
        },
        {
          "name": "GetCourses",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "urlencoded",
              "urlencoded": []
            },
            "url": {
              "raw": "{{baseURL}}/training-provider/v1/{{tpID}}/courses",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "v1",
                "{{tpID}}",
                "courses"
              ]
            },
            "description": "This endpoint is used to _get_ all the available courses with verisoning."
          },
          "response": []
        }
      ],
      "description": "### Description\n\nThis folder contains the information object endpoints for the WINDA API. These endpoints return larger, structured objects that vary in the details they provide, but they mostly relate to uploads and the actions you can perform on them, such as creating, purchasing, downloading, deleting and retrieving them.\n\nAll endpoints in the information objects group are training provider endpoints, which means that only valid training providers have access to them."
    },
    {
      "name": "Search Objects",
      "item": [
        {
          "name": "GetCourseParticipants (TP)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\"delegates\": [\"TT098322DE\"]}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseURL}}/training-provider/v1/{{tpID}}/search",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "v1",
                "{{tpID}}",
                "search"
              ]
            },
            "description": "This endpoint is used to _get_ a list of the course participants under the specified Training Provider and their Training records with course versions."
          },
          "response": []
        },
        {
          "name": "GetCourseParticipants (Org)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\"delegates\": [\"TT098322DE\"]}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseURL}}/organization/v1/{{oID}}/search",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "organization",
                "v1",
                "{{oID}}",
                "search"
              ]
            },
            "description": "This endpoint is used to _get_ a list of the course participants under the specified Organization and their Training records with course versions."
          },
          "response": []
        },
        {
          "name": "GetCourseParticipantsLegacy (TP) (Deprecated)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\"delegates\": [\"VP091733LT\"]}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseURL}}/training-provider/{{tpID}}/search",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "{{tpID}}",
                "search"
              ]
            },
            "description": "This endpoint is used to _get_ a list of the course participants under the specified Training Provider and their Training records.\n\nThis endpoint will soon be decommissioned in favor of `/training-provider/tpID/search`."
          },
          "response": []
        },
        {
          "name": "GetCourseParticipantsLegacy (Org) (Deprecated)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\"delegates\": [\"VP091733LT\"]}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseURL}}/organization/{{oID}}/search",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "organization",
                "{{oID}}",
                "search"
              ]
            },
            "description": "This endpoint is used to _get_ a list of the course participants under the specified Organization and their Training records.\n\nThis endpoint will soon be decommissioned in favor of `/organization/v1/oID/search`."
          },
          "response": []
        },
        {
          "name": "GetCourseParticipantsDelta (TP)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\"delegates\":[\"PO043771AT\"]}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseURL}}/training-provider/v1/{{tpID}}/deltasearch?fromDate=2022-05-05",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "training-provider",
                "v1",
                "{{tpID}}",
                "deltasearch"
              ],
              "query": [
                {
                  "key": "fromDate",
                  "value": "2022-05-05"
                }
              ]
            },
            "description": "This endpoint is used to _get_ a list of the course participants of a Training Provider whos Training records are created after the specified date."
          },
          "response": []
        },
        {
          "name": "GetCourseParticipantsDelta (Org)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\"delegates\":[\"VP091733LT\"]}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseURL}}/organization/v1/{{oID}}/deltasearch?fromDate=2022-05-05",
              "host": [
                "{{baseURL}}"
              ],
              "path": [
                "organization",
                "v1",
                "{{oID}}",
                "deltasearch"
              ],
              "query": [
                {
                  "key": "fromDate",
                  "value": "2022-05-05"
                }
              ]
            },
            "description": "This endpoint is used to _get_ a list of the course participants of an Organization whos Training records are created after the specified date."
          },
          "response": []
        }
      ],
      "description": "This collection group contains the **search objects** in WINDA API Test. These are endpoints used to look up course participants and the courses they have completed.\n\nThe endpoints in this group are designated as follows, so please use them according to your status:\n\n- TP: Endpoint for Training Provider accounts\n    \n- Org: Endpoint for Organization accounts\n    \n\nThe Legacy endpoints will soon be decommissioned, thus it is strongly adviced to use the non-legacy endpoints. Expanded functionality is provided in the non-legacy endpoints."
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "accessTokenURL",
      "value": "",
      "description": "URL used to get access"
    },
    {
      "key": "baseURL",
      "value": "",
      "description": "Base URL used for all endpoints (other than access endpoints)"
    },
    {
      "key": "tpID",
      "value": "",
      "description": "Training Provider ID"
    },
    {
      "key": "oID",
      "value": "",
      "description": "Origanization ID"
    },
    {
      "key": "uploadID",
      "value": "",
      "description": "Upload ID"
    }
  ]
}