-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API] Adding endpoint for project's images #3369
Conversation
adding rewrite rules adding docs
docs/API/LorisRESTAPI.md
Outdated
@@ -1,4 +1,4 @@ | |||
# Loris API - v0.0.2 | |||
# Loris API - v0.0.3-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change it meant to go in the file https://github.com/xlecours/Loris/blob/58750230e6618886030d9f00d681454ca9149a01/docs/API/LorisRESTAPI_v0.0.3.md in the tree, not the stable doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review of the doc
docs/API/LorisRESTAPI.md
Outdated
@@ -139,6 +139,29 @@ The body of the request to /projects/$ProjectName will be an entity of the form: | |||
} | |||
``` | |||
|
|||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing a section header
docs/API/LorisRESTAPI.md
Outdated
GET /projects/$ProjectName/images/ | ||
``` | ||
|
||
Will return a JSON object of the form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing a colon at the end
docs/API/LorisRESTAPI_v0.0.3.md
Outdated
@@ -139,6 +139,29 @@ The body of the request to /projects/$ProjectName will be an entity of the form: | |||
} | |||
``` | |||
|
|||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing a section header
docs/API/LorisRESTAPI_v0.0.3.md
Outdated
{ | ||
"candidate": "123456", | ||
"visit": "V1", | ||
"scan_type": Acquisition protocol ex :"t2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reason for using "js" as the type for the block instead of json elsewhere is so that you can use comments. So you can do smething like "scan_type": "t2", /* acquisition protocol */
and have it highlighted properly in the markdown.
The capitalization of this is also inconsistent with the rest of the endpoints (or at least the ones showing up as context in this diff) where the first letter is capitalized, and CapitalizedWordCase is used, not underscores.
docs/API/LorisRESTAPI_v0.0.3.md
Outdated
"candidate": "123456", | ||
"visit": "V1", | ||
"scan_type": Acquisition protocol ex :"t2", | ||
"link": URL relative to this API ex: "\/candidates\/300022\/V1\/images\/loris-MRI_123456_V1_t2_001.mnc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about using JS comments as above.
docs/API/LorisRESTAPI_v0.0.3.md
Outdated
] | ||
} | ||
``` | ||
It is possible to provide a parameter named `since` where the value need to be a date or datetime ex: 2016-08-09 or 2016-08-09 10:00:00 or 2016-08-09T10:00:00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should specify a GET parameter to avoid ambiguity of whether POST parameters are accepted.
The example values need quotation marks, and should probably only have one option to simplify things and avoid ambiguity. It'd probably be best to take an existing standardized date format that's close enough to the last option ( RFC3339? There's a built in constant in PHP for it, too, which should make it easy to parse: http://php.net/manual/en/class.datetime.php#datetime.constants.rfc3339) and reference that.
docs/API/LorisRESTAPI_v0.0.3.md
Outdated
} | ||
``` | ||
It is possible to provide a parameter named `since` where the value need to be a date or datetime ex: 2016-08-09 or 2016-08-09 10:00:00 or 2016-08-09T10:00:00 | ||
If the timezone is provided, it will be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That (ignoring timezone) seems like a bad idea.
@driusan Thanks for your comments. This PR seems much better now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think it should refer to a specific date format rather than referring to PHP documentation and saying "date format supported by PHP", but that's not a blocker.
This adds an endpoint to provide image file links. It support a single GET parameter: "?since=", which takes a date as a parameter and returns the images since that date.
This pull request adds an endpoint to provide image file links. It support a single parameter:
since
Additional data for each image would help for filtering.
There might be a need to add QC status for them as well.