DEV Community

Ameh Mathias Ejeh
Ameh Mathias Ejeh

Posted on

Onebody API Documentation

Base URL: http://localhost:5000

Register

  • POST /api/auth/register

Login

  • POST /api/auth/login

Create Artiste (Protected)

  • POST /api/artistes

Response

{
    "success": true,
    "message": "Artiste created successfully",
    "data": {
        "artiste": {
            "id": 4,
            "name": "Samuel Adedayo",
            "desc": "A marvelous gospel singer",
            "image": "uploads\\artistes\\image-1764242219273-893646722.png",
            "updatedAt": "2025-11-27T11:17:00.716Z",
            "createdAt": "2025-11-27T11:17:00.716Z"
        }
    }
}

Enter fullscreen mode Exit fullscreen mode

Get all Artistes

  • GET /api/artistes

Response

{
    "success": true,
    "count": 4,
    "data": {
        "artistes": [
            {
                "id": 4,
                "name": "Samuel Adedayo",
                "image": "uploads\\artistes\\image-1764242219273-893646722.png",
                "desc": "A marvelous gospel singer",
                "createdAt": "2025-11-27T11:17:00.716Z",
                "updatedAt": "2025-11-27T11:17:00.716Z"
            },
            {
                "id": 3,
                "name": "Tito Pelumi",
                "image": "uploads\\artistes\\image-1764152676621-764537291.png",
                "desc": "A marvelous gospel singer",
                "createdAt": "2025-11-26T10:24:37.237Z",
                "updatedAt": "2025-11-26T10:24:37.237Z"
            },
            {
                "id": 2,
                "name": "Emmanuel Ajose",
                "image": "uploads\\artistes\\image-1764110414208-444407115.png",
                "desc": "A renowned gospel artiste ",
                "createdAt": "2025-11-25T22:40:14.275Z",
                "updatedAt": "2025-11-25T22:44:08.193Z"
            },
            {
                "id": 1,
                "name": "John Kenny",
                "image": "uploads\\artistes\\image-1764110357952-755066802.png",
                "desc": "A marvelous gospel singer",
                "createdAt": "2025-11-25T22:39:18.155Z",
                "updatedAt": "2025-11-25T22:39:18.155Z"
            }
        ]
    }
}
Enter fullscreen mode Exit fullscreen mode

Get Artiste by id

  • GET /api/artistes/:id

Response

{
    "success": true,
    "data": {
        "artiste": {
            "id": 2,
            "name": "Emmanuel Ajose",
            "image": "uploads\\artistes\\image-1764110414208-444407115.png",
            "desc": "A renowned gospel artiste ",
            "createdAt": "2025-11-25T22:40:14.275Z",
            "updatedAt": "2025-11-25T22:44:08.193Z",
            "albums": [
                {
                    "id": 2,
                    "name": "Here I Am",
                    "artisteId": 2,
                    "releaseYear": 2022,
                    "image": "uploads\\albums\\image-1764111099366-720471625.jpg",
                    "createdAt": "2025-11-25T22:51:39.424Z",
                    "updatedAt": "2025-11-25T22:51:39.424Z"
                }
            ],
            "songs": [
                {
                    "id": 2,
                    "name": "Orin Davadi",
                    "artisteId": 2,
                    "albumId": 1,
                    "lyrics": "Morning light is here\nDrowning out all my fears of the night\nOh delight in me\nLiving word show forth yourself \nAnd eternity is singing\nLike the waves breaking the shores of my heart\nRolling on and on\nNever stopping I’m in awe\n\nOh my heart is pleading Savior come\nSavior won’t you come and help me\nI am tired your mercy all that I need\nYes my heart is singing Savior help \nSavior won’t you help\nIn this life your strength is all that I need\nYour strength is all I need\nSavior come\nOh oh oh\n\nAs this drizzle falls softening testing the state of my heart\nOh your word is rain pouring down farmers are glad\nYet eternity is screaming buckets outs \nsoak it all up while it lasts\nLet my heart be sure even as the seasons return \n\nOh my heart is pleading Savior come\nSavior won’t you come oh\nI am tired your mercy all that I need\nYes my heart is singing Savior help \nSavior won’t you help\nIn this life your strength is all that I need\nYeah\n\nSavior wont you come\nYou strength is all that I need\nOh oh oh\nSavior won’t you come\nHelp me now help me now\nOh oh oh \n\n\nHere’s my offering before I give I know you loved\nmercy more\nLet your fire fall I will give it all all the same hmm\nStill eternity is dancing tambourines and cymbals of\ntime never stop oh\nFor my faith is strong \nI’ll be standing when you return\n \nOh my heart is pleading Savior come\nSavior won’t you come oh\nI am tired your mercy all that I need\nOh my heart is singing help \nSavior help me\nIn this life your strength is all that I need\nAll that I need yeah\nOh oh oh\nI need your help\nI need your help savior\nYou are all that I need\nOh oh\n\nMorning light is here\nDrowning out all my fears of the night\nOh delight in me\nLiving word show forth yourself \n",
                    "image": null,
                    "createdAt": "2025-11-25T23:05:06.873Z",
                    "updatedAt": "2025-11-25T23:05:06.873Z"
                }
            ]
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Create Album (Protected)

  • POST /api/albums

Response

{
    "success": true,
    "message": "Album created successfully",
    "data": {
        "album": {
            "id": 3,
            "name": "Mercy",
            "artisteId": 4,
            "releaseYear": 2025,
            "image": "uploads\\albums\\image-1764243719856-4963630.jpg",
            "updatedAt": "2025-11-27T11:42:00.414Z",
            "createdAt": "2025-11-27T11:42:00.414Z"
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Get all Album

  • GET /api/albums

Response

{
    "success": true,
    "currentPage": 1,
    "totalPages": 1,
    "totalItems": 3,
    "data": {
        "albums": [
            {
                "id": 3,
                "name": "Mercy",
                "artisteId": 4,
                "releaseYear": 2025,
                "image": "uploads\\albums\\image-1764243719856-4963630.jpg",
                "createdAt": "2025-11-27T11:42:00.414Z",
                "updatedAt": "2025-11-27T11:42:00.414Z",
                "artiste": {
                    "id": 4,
                    "name": "Samuel Adedayo",
                    "image": "uploads\\artistes\\image-1764242219273-893646722.png"
                }
            },
            {
                "id": 1,
                "name": "Glorious God",
                "artisteId": 1,
                "releaseYear": 2024,
                "image": "uploads\\albums\\image-1764111430083-847458251.jpg",
                "createdAt": "2025-11-25T22:50:00.036Z",
                "updatedAt": "2025-11-25T22:57:10.117Z",
                "artiste": {
                    "id": 1,
                    "name": "John Kenny",
                    "image": "uploads\\artistes\\image-1764110357952-755066802.png"
                }
            },
            {
                "id": 2,
                "name": "Here I Am",
                "artisteId": 2,
                "releaseYear": 2022,
                "image": "uploads\\albums\\image-1764111099366-720471625.jpg",
                "createdAt": "2025-11-25T22:51:39.424Z",
                "updatedAt": "2025-11-25T22:51:39.424Z",
                "artiste": {
                    "id": 2,
                    "name": "Emmanuel Ajose",
                    "image": "uploads\\artistes\\image-1764110414208-444407115.png"
                }
            }
        ]
    }
}
Enter fullscreen mode Exit fullscreen mode

Get Album by id

  • GET /api/albums/:id

Response

{
    "success": true,
    "data": {
        "album": {
            "id": 2,
            "name": "Here I Am",
            "artisteId": 2,
            "releaseYear": 2022,
            "image": "uploads\\albums\\image-1764111099366-720471625.jpg",
            "createdAt": "2025-11-25T22:51:39.424Z",
            "updatedAt": "2025-11-25T22:51:39.424Z",
            "artiste": {
                "id": 2,
                "name": "Emmanuel Ajose",
                "image": "uploads\\artistes\\image-1764110414208-444407115.png",
                "desc": "A renowned gospel artiste "
            },
            "songs": [
                {
                    "id": 1,
                    "name": "Morning Light"
                },
                {
                    "id": 8,
                    "name": "Calling on my Saviour"
                }
            ]
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Create Song (Protected)

  • POST /api/songs

Response

{
    "success": true,
    "message": "Song created successfully",
    "data": {
        "song": {
            "id": 9,
            "name": "In HIs Presence",
            "artisteId": 1,
            "albumId": 3,
            "lyrics": "Morning light is here\nDrowning out all my fears of the night\nOh delight in me\nLiving word show forth yourself \nAnd eternity is singing\nLike the waves breaking the shores of my heart\nRolling on and on\nNever stopping I’m in awe\n\nOh my heart is pleading Savior come\nSavior won’t you come and help me\nI am tired your mercy all that I need\nYes my heart is singing Savior help \nSavior won’t you help\nIn this life your strength is all that I need\nYour strength is all I need\nSavior come\nOh oh oh\n\nAs this drizzle falls softening testing the state of my heart\nOh your word is rain pouring down farmers are glad\nYet eternity is screaming buckets outs \nsoak it all up while it lasts\nLet my heart be sure even as the seasons return \n\nOh my heart is pleading Savior come\nSavior won’t you come oh\nI am tired your mercy all that I need\nYes my heart is singing Savior help \nSavior won’t you help\nIn this life your strength is all that I need\nYeah\n\nSavior wont you come\nYou strength is all that I need\nOh oh oh\nSavior won’t you come\nHelp me now help me now\nOh oh oh \n\n\nHere’s my offering before I give I know you loved\nmercy more\nLet your fire fall I will give it all all the same hmm\nStill eternity is dancing tambourines and cymbals of\ntime never stop oh\nFor my faith is strong \nI’ll be standing when you return\n \nOh my heart is pleading Savior come\nSavior won’t you come oh\nI am tired your mercy all that I need\nOh my heart is singing help \nSavior help me\nIn this life your strength is all that I need\nAll that I need yeah\nOh oh oh\nI need your help\nI need your help savior\nYou are all that I need\nOh oh\n\nMorning light is here\nDrowning out all my fears of the night\nOh delight in me\nLiving word show forth yourself \n",
            "image": "uploads\\songs\\image-1764244937159-222340483.jpg",
            "createdAt": "2025-11-27T12:02:17.532Z",
            "updatedAt": "2025-11-27T12:02:17.532Z",
            "mainArtiste": {
                "id": 1,
                "name": "John Kenny",
                "image": "uploads\\artistes\\image-1764110357952-755066802.png"
            },
            "album": {
                "id": 3,
                "name": "Mercy",
                "image": "uploads\\albums\\image-1764243719856-4963630.jpg"
            },
            "featuredArtistes": [
                {
                    "id": 2,
                    "name": "Emmanuel Ajose",
                    "image": "uploads\\artistes\\image-1764110414208-444407115.png"
                },
                {
                    "id": 3,
                    "name": "Tito Pelumi",
                    "image": "uploads\\artistes\\image-1764152676621-764537291.png"
                }
            ]
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Get all Songs

  • GET /api/songs

Response

{
    "success": true,
    "currentPage": 1,
    "totalPages": 1,
    "totalItems": 4,
    "data": {
        "songs": [
            {
                "id": 9,
                "name": "In HIs Presence",
                "image": "uploads\\songs\\image-1764244937159-222340483.jpg",
                "createdAt": "2025-11-27T12:02:17.532Z"
            },
            {
                "id": 8,
                "name": "Calling on my Saviour",
                "image": null,
                "createdAt": "2025-11-27T10:48:44.576Z"
            },
            {
                "id": 2,
                "name": "Orin Davadi",
                "image": null,
                "createdAt": "2025-11-25T23:05:06.873Z"
            },
            {
                "id": 1,
                "name": "Morning Light",
                "image": null,
                "createdAt": "2025-11-25T23:03:20.744Z"
            }
        ]
    }
}
Enter fullscreen mode Exit fullscreen mode

Get Song by id

  • GET /api/songs/:id

Response

{
    "success": true,
    "data": {
        "song": {
            "id": 8,
            "name": "Calling on my Saviour",
            "artisteId": 3,
            "albumId": 2,
            "lyrics": "Morning light is here\nDrowning out all my fears of the night\nOh delight in me\nLiving word show forth yourself \nAnd eternity is singing\nLike the waves breaking the shores of my heart\nRolling on and on\nNever stopping I’m in awe\n\nOh my heart is pleading Savior come\nSavior won’t you come and help me\nI am tired your mercy all that I need\nYes my heart is singing Savior help \nSavior won’t you help\nIn this life your strength is all that I need\nYour strength is all I need\nSavior come\nOh oh oh\n\nAs this drizzle falls softening testing the state of my heart\nOh your word is rain pouring down farmers are glad\nYet eternity is screaming buckets outs \nsoak it all up while it lasts\nLet my heart be sure even as the seasons return \n\nOh my heart is pleading Savior come\nSavior won’t you come oh\nI am tired your mercy all that I need\nYes my heart is singing Savior help \nSavior won’t you help\nIn this life your strength is all that I need\nYeah\n\nSavior wont you come\nYou strength is all that I need\nOh oh oh\nSavior won’t you come\nHelp me now help me now\nOh oh oh \n\n\nHere’s my offering before I give I know you loved\nmercy more\nLet your fire fall I will give it all all the same hmm\nStill eternity is dancing tambourines and cymbals of\ntime never stop oh\nFor my faith is strong \nI’ll be standing when you return\n \nOh my heart is pleading Savior come\nSavior won’t you come oh\nI am tired your mercy all that I need\nOh my heart is singing help \nSavior help me\nIn this life your strength is all that I need\nAll that I need yeah\nOh oh oh\nI need your help\nI need your help savior\nYou are all that I need\nOh oh\n\nMorning light is here\nDrowning out all my fears of the night\nOh delight in me\nLiving word show forth yourself \n",
            "image": null,
            "createdAt": "2025-11-27T10:48:44.576Z",
            "updatedAt": "2025-11-27T10:48:44.576Z",
            "mainArtiste": {
                "id": 3,
                "name": "Tito Pelumi"
            },
            "album": {
                "id": 2,
                "name": "Here I Am"
            },
            "featuredArtistes": [
                {
                    "id": 1,
                    "name": "John Kenny"
                }
            ]
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)