logo
down
shadow

How to design REST API for export endpoint?


How to design REST API for export endpoint?

By : davidrafal
Date : November 22 2020, 02:59 PM
it should still fix some issue In fact you should consider HTTP content negotiation (or CONNEG) to do this. This leverages the Accept header (see the HTTP specification: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1) that specifies which is the expected media type for the response.
For example, for CSV, you could have something like that:
code :
GET /api/alerts
Accept: text/csv
GET /api/alerts
Accept: text/csv

HTTP/1.1 200 OK
Content-Disposition: attachment; filename="alerts.csv" 

(...)


Share : facebook icon twitter icon
Correct REST endpoint design when dealing with messaging

Correct REST endpoint design when dealing with messaging


By : Harry
Date : March 29 2020, 07:55 AM
it should still fix some issue I'm struggling to work out the correct REST endpoints for a certain situation. On my website it's possible for users to send messages to each other. One user is able to send messages to multiple recipients. , I would expect
code :
/v1/users/123/messages
/v1/users/123/messages?type=received&folder=important
REST API design for endpoint with notification

REST API design for endpoint with notification


By : RickyFlips
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I think your design works. Why would the client care if the mail service is not working? If the order passes all validations on the server and is persisted I would treat that as a successful state and return 201 Created.
When the client gets 201 Created, then do what you say; give the user a message about checking their mail, but tell them that they should have some patience. Something like:
REST endpoint design for retrieving results in many to many relationship

REST endpoint design for retrieving results in many to many relationship


By : Marco H
Date : March 29 2020, 07:55 AM
I hope this helps you . For the first scenario, it really depends on what your use cases are. GET /courses/instructors would imply (only) retrieving the instructors, so I'd personally go with just GET /courses, and embed the instructors.
As for the second scenario, /courses?name=coursename should be good enough (plus /courses/{courseId}/instructors/{instructorId} for drilling down to a specific entry). The 2 calls is another valid option. However, an URL like /courses?name=coursename/instructors doesn't seem to be valid, according to RFC 3986.
REST API design: the endpoint which returns a report

REST API design: the endpoint which returns a report


By : Delta
Date : March 29 2020, 07:55 AM
I wish this helpful for you the resource (data) should be independent from the formatting/encoding whether it is xml, json, xls, csv, etc should be determined through "content negotiation" usually accomplished by using the "accept" header.
REST API Design: Should we use same endpoint with diff params or create a new endpoint

REST API Design: Should we use same endpoint with diff params or create a new endpoint


By : user5619660
Date : March 29 2020, 07:55 AM
To fix the issue you can do Given that both intended endpoints/endpoint return the same thing, I might opt for keeping a single REST endpoint which accepts all possible parameters:
shadow
Privacy Policy - Terms - Contact Us © animezone.co