{"pageProps":{"doc":{"title":"Docs v1","slug":"","content":"\n# UMWics API Docs\n\n## Introduction\n\nThe UMWics API provieds access to the data for this, , website. Although the API was built for our site, we allow anyone to use the API as it's a great way to learn how to interface with API's. You don't need an API key to make \"read\" API calls (GET requests), however if you want to write data with our API you will need to request access from the WICS Website committee.\n\n## Setup\n\nTo make calls to the API you just need to specify the URL to the data you wish to access. For example if you want to access all the UMWics members you can send a request to `https://umwics.vercel.app/api/v1/members` and you will get a JSON response with a list of our members.\n\n## Sample Code\n\nBelow is some sample code in various languages showing how to use our API.\n\n#### Python\n\n```python\nimport requests\n\nurl = \"https://umwics.vercel.app/api/v1/members\"\nresponse = requests.get(url)\n\nprint(response.status_code) # 200\nprint(response.json()) # { 'members': [ { 'id': 'UAcL...', ... }, ... ] }\n```\n\n#### Java\n\n```java\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.http.HttpResponse.BodyHandlers;\nimport java.net.URI;\n\nimport org.json.JSONObject;\n\npublic class Main {\n public static void main(String[] args) {\n String url = \"https://umwics.vercel.app/api/v1/members\";\n\n HttpClient client = HttpClient.newHttpClient();\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(url))\n .build();\n client.sendAsync(request, BodyHandlers.ofString())\n .thenApply(HttpResponse::body)\n .thenApply(JSONObject::new) // If you want to work with JSON\n .thenAccept(System.out::println) // { \"members\": [ { \"id\": \"UAcL...\", ... }, ... ] }\n .join();\n }\n}\n```\n\n#### Javascript\n\n```javascript\nconst url = \"https://umwics.vercel.app/api/v1/members\";\n\nfetch(url)\n .then(response => response.json())\n .then(console.log) // { members: [ { id: \"UAcL...\", ... }, ... ] }\n .catch(console.error);\n```\n\n#### Javascript (Node.js)\n\n```javascript\nconst fetch = require(\"node-fetch\"); // import fetch from \"node-fetch\"; if you are using esm\n\nconst url = \"https://umwics.vercel.app/api/v1/members\";\n\nfetch(url)\n .then(response => response.json())\n .then(console.log) // { members: [ { id: \"UAcL...\", ... }, ... ] }\n .catch(console.error);\n```\n\n#### With curl\n\n```bash\ncurl -X GET \"https://umwics.vercel.app/api/v1/members\" # { \"members\": [ { \"id\": \"UAcL...\", ... }, ... ] }\n```\n\n## What's Next?\n\nNow that you have a way to request the data, you can checkout the specific endpoints in the sidebar for further details in what form the data is served in.\n"}},"__N_SSG":true}