I am making an API system which follows url like localhost:8080/api/v1/end_name
and i'm using django-rest-framework-social-oauth2 library for social authentication also for my custom user authentication. The problem is they are providing api response for url like localhost:8080/auth/token
in following format e.g.
{
"access_token": "........",
"expires_in": 36000,
"token_type": "Bearer",
"scope": "read write",
"refresh_token": "......"
}
but i need to customize it in my way as my response format is different. My one is like following..
{
"error": false,
"message": "User created successfully",
"data": {
"email": "localtestuse2@beliefit.com"
}
}
i need the response in my data: {}
. My one question is
- How can I do it?
My another question is
- Can i customize the api url
localhost:8080/auth/token
tolocalhost:8080/api/v1/auth/token
?