I am new to Restful concept and have to design a simple API for a media analysis service I need to set up, to perform various tasks, e.g. face analysis, region detection, etc. on uploaded images and video.
Outline of my initial design is as follows:
- Client POSTs a configuration XML file to
http://manalysis.com/facerecognition
. This creates a profile that can be used for multiple analysis sessions. Response XML includes aProfileID
to refer to this profile. Clients can skip this step to use the default config parameters - Client POSTs video data to be analyzed to
http://manalysis.com/facerecognition
(with ProfileID as a parameter, if it's set up). This creates an analysis session. Return XML has theSessionID
. - Client can send a GET to
http://manalysis.com/facerecognition/SessionID
to receive the status of the session.
Am I on the right track? Specifically, I have the following questions:
- Should I include
facerecognition
in the URL? Roy Fielding says that "a REST API must not define fixed resource names or hierarchies" Is this an instance of that mistake? - The analysis results can either be returned to the client in one large XML file or when each event is detected. How should I tell the analysis engine where to return the results?
- Should I explicitly delete a profile when analysis is done, through a DELETE call?
Thanks,
C