-
Notifications
You must be signed in to change notification settings - Fork 64
Star
The API exposes a representation of a star
resource that denotes user preference for a concept, source or collection. Users may "star" or "unstar" concepts, similar to stars in Gmail, in that it is an organizational function with a visual reminder. Stars may be used to improve search results through smart sorting if a user is logged in. The status of a star is queried or set for a user through GET, POST or DELETE by specifying the object that you wish to request the star for (can be a concept, source, or collection).
Example uses:
GET /rest/star?username=jdoe # get all stars for the user
GET /rest/star?concept=1234 # get all stars for the concept
GET /rest/star?collection=1234
GET /rest/star?resource=1234
GET /rest/star?username=jdoe&concept=1234 # get star for specific user and concept
To set the status of a star to "on" for a particular user:
POST /rest/star?username=jdoe&concept=12345
To remove a star for a user:
DELETE /rest/star?username=jdoe&concept=12345
URI: /rest/star
uuid
url
display # e.g. "Star: Collection: Rapid SMS Default"
displayLocale
retired
properties
auditInfo
resourceVersion
resource # ref of starred resource
resourceType
uuid
url
username
dateStarred
GET Ref | GET Default | GET Full | POST Create | PUT Update |
---|---|---|---|---|
uuid url |
uuid url username dateStarred resource state properties links resourceVersion |
uuid url username dateStarred resource state properties links resourceVersion |
resource (eg concept UUID) state username |
resource (eg concept UUID state username |
URL | Description | Response Code |
---|---|---|
GET /rest/star?username=jdoe&concept=123 |
Returns the user's star status for concept 123 (answer is on true or false) | OK / Success Not Found |
GET /rest/star?username=jdoe&collection=123 |
Returns the user's star status for collection 123 | OK / Success Not Found |
GET /rest/star?concept=123 |
Returns a list of stars for the concept in full representation | OK / Success Not Found |
GET /rest/star?collection=123 |
Returns a list of stars for the collection in full representation | OK / Success Not Found |
GET /rest/star/starCount?concept=123 |
Get a total count of the stars selected for concept 123 Is it advisable to return this number in the header of a GET /rest/star?concept=123 ??? |
OK / Success Not Found |
GET /rest/star/starCount?collection=123 |
Get a total count of the stars selected for collection identified 123 Is it advisable to return this number in the header of a GET /rest/star?collection=123 ??? |
OK / Success Not Found |
GET /rest/star?username={username} |
get all concepts & collections that the user has starred | OK / Success Not Found |
POST /rest/star?username=jdoe&concept=12345 |
Sets the star state to "on" for the concept/user. Message body is ignored. | OK / Success Not Found Duplicate/No change?? |
POST /rest/star?username=jdoe&collection=1234 |
Sets the star state to "on" for the collection/user. Message body is ignored. | OK / Success Not Found Duplicate/No change?? |
DELETE /rest/star?username=jdoe&concept=12345 |
Sets the star state to "off" for the concept/user. | OK / Success Not Found |
DELETE /rest/star/jdoe?collection=12345 |
Sets the star state to "off" for the collection/user. | OK / Success Not Found |
A sample GET request
{
"__type__": "OclStar",
"uuid" : "bwhefw82-ur2usdmf-ndefwee",
"url" : "/rest/star/bwhefw82-ur2usdmf-ndefwee",
"display": "Star: Collection: Rapid SMS Default",
"displayLocale": "en",
"retired": false,
"properties": {},
"auditInfo": {},
"resourceVersion": "0.9",
"resource": {
"resourceType": "collection",
"display": "Rapid SMS Default",
"url": "/rest/collection/8d492ee0-c2cc-11de-8d13-0010c6dffd0f"
},
"username": "judy",
"dateStarred": "2011-04-14T16:00:49Z"
}
Sample POST /rest/star/jdoe?concept=12345
{
"conceptid": {conceptid},
"username": {username}
}
Sample DELETE /rest/star/jdoe?concept=12345
{
"conceptid": {conceptid},
"username": {username}
}
Overview
Resources
Import / Export
- CSV Import
- Bulk Import
- Org/Source Import
- Export API
- Subscriptions
- Subscription Client Testing Process
- OpenMRS to OCL Mapping
Troubleshooting & Operations
- Data integrity checks
- Maintaining OCLAPI's Docker containers
- Maintaining MongoDB and Solr
- How to check logs
- NewRelic monitoring setup
- Configuration changes to make tests and import job run faster
- Accessing Solr UI Remotely
- Data Backup and Restore
- SSL Configuration
- Flower
- Switching to Maintenance Mode on Production Server
- Docker networking and Security
Other