From e9e3d1aaa3405edb283908aae6f4318f2758be76 Mon Sep 17 00:00:00 2001 From: Kun Deng Date: Wed, 17 Jul 2019 21:13:27 -0400 Subject: [PATCH] Updated Version 1.0 API (markdown) --- Version-1.0-API.md | 71 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/Version-1.0-API.md b/Version-1.0-API.md index 73e0b61..b5ff327 100644 --- a/Version-1.0-API.md +++ b/Version-1.0-API.md @@ -1,5 +1,5 @@ # Version 1.0 API -This page contains API documentation regarding version 1.0 if the API. For the sake of the examples I will use +This page contains API documentation regarding version 1.0 if the API. For the sake of the examples I will use icarus-demo.com as the hostname and https. Though if you are using Icarus without a host name you can merely provide the IP address coupled with the port number. ## API Categories * Authentication @@ -10,9 +10,74 @@ This page contains API documentation regarding version 1.0 if the API. For the s * Year * Cover art +## Authentication +### Retrieving token +**URI**: https://icarus-demo.com/api/v1/login +**Method**: Post +**Content type**: application/json +**Request body**: +```Json +{ + "username":"usr", + "password":"secret" +} +``` +**Response body**: +```Json +{ + "id":1, + "username":"usr", + "token":"dsfsdfnisdnosnfwefh923hr329hf29fb293fhn20jf20f", + "token_type":"Bearer", + "expiration":8000 +} +``` + ## Songs -### Uploading Songs +### Uploading Song +**URI**: https://icarus-demo.com/api/v1/song/data **Method**: Post **Content type**: multipart/form-data -**Authorization**: Bearer ``token`` \ No newline at end of file +**Authorization**: Bearer ``token`` +**File**: @file=/path/to/song/you/wish/to/upload.mp3 + +### Downloading Song +**URI**: https://icarus-demo.com/api/v1/song/data/id +**Method**: Get +**Authorization**: Bearer ``token`` + +### Delete Song +**URL**: https://icarus-demo.com/api/v1/song/id +**Method**: Delete +**Authorization**: Bearer ``token`` + +### Updating Song Metadata +**URI**: https://icarus-demo.com/api/v1/song/id +**Method**: Update +**Authorization**: Bearer ``token`` +**Request body**: +```Json +{ + "title":"updated title", + "artist":"updated artist", + "album":"updated album", + "genre":"updated genre", + "year":"updated year" +} +``` + +### Retrieve Song Metadata +**URI**: https://icarus-demo.com/api/v1/song/id +**Method**: Get +**Authorization**: Bearer ``token`` +**Response body**: +```Json +{ + "title":"Song Title", + "artist":"Artist or Band", + "album":"Album Name", + "genre":"Genre", + "year":1970 +} +``` \ No newline at end of file