ContextNote REST API

Monday 20th of May 2013 01:01:39 PM


  Toggle Advanced Options



End-points (URIs)

Miscellaneous

  • Language (code) must be added as a query parameter.
  • Authentication with HTTP Basic Authentication (over HTTPS) or Digest Authentication.

General URI format is:

http://api.contextnote.com/{ver}/{resource_type}/{resource_id}?{filters as arguments}

Topics

  • Collection
    • GET
      • /topics; returns 200 (OK), list of topics. Use pagination, sorting and filtering to navigate big lists. DONE!
      • /topics/{id}/occurrences; returns 200 (OK), list of occurrences. DONE!
      • /topics/{id}/associations; returns 200 (OK), list of associations. DONE!
      • /topics/{id}/metadata; returns 200 (OK), list of meta data. DONE!
    • POST
      • /topics; returns 201 (Created), 'Location' header with link to topics/{id} containing new ID.
      • /topics/{id}/occurrences; returns 201 (Created), 'Location' header with link to occurrences/{id} containing new ID.
      • /topics/{id}/associations; returns 201 (Created), 'Location' header with link to associations/{id} containing new ID.
      • /topics/{id}/metadata; returns 201 (Created), 'Location' header with link to metadata/{id} containing new ID.
  • Specific item
    • GET
      • /topics/{id}; returns 200 (OK), single topic. 404 (Not Found), if topic ID not found or invalid. DONE!
      • /topics/{id}/occurrences/{id}; returns 200 (OK), single occurrence. 404 (Not Found), if occurrence ID not found or invalid.
      • /topics/{id}/associations/{id}; returns 200 (OK), single association. 404 (Not Found), if association ID not found or invalid.
      • /topics/{id}/metadata/{id}; returns 200 (OK), single meta datum. 404 (Not Found), if meta datum ID not found or invalid.
    • PUT
      • /topics/{id}; returns 200 (OK) or 204 (No Content). 404 (Not Found), if topic ID not found or invalid.
      • /topics/{id}/occurrences/{id}; returns 200 (OK) or 204 (No Content). 404 (Not Found), if occurrence ID not found or invalid.
      • /topics/{id}/associations/{id}; returns 200 (OK) or 204 (No Content). 404 (Not Found), if association ID not found or invalid.
      • /topics/{id}/metadata/{id}; returns 200 (OK) or 204 (No Content). 404 (Not Found), if meta datum ID not found or invalid.
    • DELETE
      • /topics/{id}; returns 200 (OK). 404 (Not Found), if topic ID not found or invalid.
      • /topics/{id}/occurrences/{id}; returns 200 (OK). 404 (Not Found), if occurrence ID not found or invalid.
      • /topics/{id}/associations/{id}; returns 200 (OK). 404 (Not Found), if association ID not found or invalid.
      • /topics/{id}/metadata/{id}; returns 200 (OK). 404 (Not Found), if meta datum ID not found or invalid.

Associations

  • Collection
    • GET
      • /associations/{id}/occurrences; returns 200 (OK), list of occurrences.
      • /associations/{id}/metadata; returns 200 (OK), list of meta data.
    • POST
      • /associations; returns 201 (Created), 'Location' header with link to associations/{id} containing new ID.
  • Specific item
    • GET
      • /associations/{id}; returns 200 (OK), single association. 404 (Not Found), if association ID not found or invalid.
    • PUT
    • DELETE

Occurrences

  • Collection
    • GET
      • /occurrences/{id}/metadata; returns 200 (OK), list of meta data.
    • POST
      • /occurrences; returns 201 (Created), 'Location' header with link to occurrences/{id} containing new ID.
  • Specific item
    • GET
      • /occurrences/{id}; returns 200 (OK), single occurrence. 404 (Not Found), if occurrence ID not found or invalid.
    • PUT
    • DELETE

Meta data

  • Collection
    • GET
    • POST
      • /metadata; returns 201 (Created), 'Location' header with link to metadata/{id} containing new ID.
  • Specific item
    • GET
      • /metadata/{id}; returns 200 (OK), single meta datum. 404 (Not Found), if meta datum ID not found or invalid.
    • PUT
    • DELETE

Response JSON payloads

End-point: GET http://api.contextnote.com/v1/topics/contextnote?lang=en

{
    "self": "http://api.contextnote.com/v1/topics/contextnote",
    "user": "10001",
    "language": "en",
    "date": "Mon May 20 13:36:23 CEST 2013",
    "next": "http://api.contextnote.com/v1/topics/contextnote-android-app",
    "previous": "http://api.contextnote.com/v1/topics/contextnote-ios-app",
    "topic":
    {
        "identifier": "contextnote",
        "instanceOf": "topic",
        "baseNames":
        [
            {
                "name": "ContextNote Personal Semantic Knowledge Management Application",
                "language": "en"
            }
        ],
        "occurrences":
        [
            {
                "self": "http://api.contextnote.com/v1/occurrences/b58aa54e-5c42-4407-86fe-4f24b5f8a06b",
                "identifier": "b58aa54e-5c42-4407-86fe-4f24b5f8a06b",
                "instanceOf": "image/png",
                "scope": "*",
                "resourceRef": "http://www.contextnote.com/images/contextnote/image1.png",
                "language": "en"
            },
            {
                "self": "v1/occurrences/b4dedad6-41c1-44b0-8abc-caa7d6f28a55",
                "identifier": "b4dedad6-41c1-44b0-8abc-caa7d6f28a55",
                "instanceOf": "text/plain",
                "scope": "*",
                "resourceRef": "http://www.contextnote.com/text/contextnote/text1.txt",
                "language": "en"
            }
        ],
        "metaData": 
        [
            {
                "self": "http://api.contextnote.com/v1/metadata/0ec04cf3-7be7-4b96-a69b-002ca4991520",
                "identifier": "0ec04cf3-7be7-4b96-a69b-002ca4991520",
                "name": "creation-time",
                "value": "Mon May 20 12:26:53 CEST 2013",
                "dataType": "string",
                "scope": "*",
                "language": "en"
            },
            {
                "self": "http://api.contextnote.com/v1/metadata/0f30c8f3-9e3a-480b-a11a-b8c130f0fb76",
                "identifier": "0f30c8f3-9e3a-480b-a11a-b8c130f0fb76",
                "name": "modification-time",
                "value": "Mon May 20 12:26:53 CEST 2013",
                "dataType": "string",
                "scope": "*",
                "language": "en"
            }
        ]
    }
}

For sake of brevity, the individual occurrence elements do not have the accompanying meta data included.







Google