hi, I'm a full stack web developer. I love UI design and have weakness for beautifully designed
functional web apps. when I am not coding, I am GAMING or READING. #potterHead
the API#2 will be doing exactly the same thing as API#1. so for example if one of the API#1 endpoints says: /api/v1/users gets us a JSON like {name: jhon, age:1}
then
this API #2 would have exactly a mirror endpoint and it is supposed to return exactly the same data so in this case API#2 would be:
/api/v2/users ===> {name: jhon, age:1}
Passionate about education, fintech, Python, Javascript, progressive growth, and full-stack development.
Sometimes I write code, sometimes I just write.
hi, I'm a full stack web developer. I love UI design and have weakness for beautifully designed
functional web apps. when I am not coding, I am GAMING or READING. #potterHead
I know it's pointless. but this is an academic activity. I don't see the point of doing such a practice, but I'm supposed to do it anyway, so could you tell me what's the best way to do this?
so far what I have planned is that create a regular django project, and create URLs that match with the API#1 endpoints, and connect those URLs to their views and then inside views just get data in JSON from API#1 and return the same JSON data back. and have little error handling thrown it.
so what do you think? does that sound good enough for this job? let me know if there's a better way to do this. API#1 also involves few POST requests and most of the endpoints use Auth/login as well.
Passionate about education, fintech, Python, Javascript, progressive growth, and full-stack development.
Sometimes I write code, sometimes I just write.
Oh, that makes more sense now.
So, your approach is fine. The authentication part would be a bit tricky but you can pass the token as a parameter in your headers as you're posting to API#1. Then the response you get, you dump it to the db of API#2.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hi thanks for your reply.
the API#2 will be doing exactly the same thing as API#1. so for example if one of the API#1 endpoints says: /api/v1/users gets us a JSON like {name: jhon, age:1}
then
this API #2 would have exactly a mirror endpoint and it is supposed to return exactly the same data so in this case API#2 would be:
/api/v2/users ===> {name: jhon, age:1}
Then what's the point of API2 if you get the same result from API1?
Also wondering the same.
Are you supposed to dump this data on the models of API#2?
hi friends, thanks for you reply.
I know it's pointless. but this is an academic activity. I don't see the point of doing such a practice, but I'm supposed to do it anyway, so could you tell me what's the best way to do this?
so far what I have planned is that create a regular django project, and create URLs that match with the API#1 endpoints, and connect those URLs to their views and then inside views just get data in JSON from API#1 and return the same JSON data back. and have little error handling thrown it.
so what do you think? does that sound good enough for this job? let me know if there's a better way to do this. API#1 also involves few POST requests and most of the endpoints use Auth/login as well.
Oh, that makes more sense now.
So, your approach is fine. The authentication part would be a bit tricky but you can pass the token as a parameter in your headers as you're posting to API#1. Then the response you get, you dump it to the db of API#2.