Skip to content

Annotation Manipulation

Steve Nolen edited this page Mar 18, 2016 · 28 revisions

What does it do?

Allows users to create annotations on survey responses.

URI

annotation/survey_response/create

Accessibility

Campaign supervisors may create survey response annotations for all participants in their campaigns.

Input Parameters

  • (r) auth_token = authentication token.
  • (r) client = the ubiquitous client parameter
  • (r) survey_id = the id of the survey to be annotated
  • (r) time = the UNIX epoch milliseconds at which this annotation was created
  • (r) timezone = the timezone ID in which this annotation was created
  • (r) annotation = the annotation text.

Example survey response annotation creation POST

POST /app/annotation/survey_response/create HTTP/1.1
 Host: dev.ohmage.org
 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
 Content-Length: byte-length-of-content
 Content-Type: application/x-www-form-urlencoded

 auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26
 &client=omh.dvu.ptsd
 &survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0
 &annotation=annotation text here
 &time=1328312397
 &timezone=GMT

cURL Example

curl -v -d "auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26&client=omh.dvu.ptsd&survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0&time=1328312397&timezone=GMT&annotation=annotation text" http://localhost:8080/app/annotation/survey_response/create

Output Format

Success

{
   "result" : "success",
   "id" : "89a206c6-4ec1-11e1-a26e-e4ce8f075a7e"
}

Failure

See the error page for a description of error codes and their associated descriptions.

↑ Back to Top

What does it do?

Allows supervisors in campaigns to read their annotations on participant survey responses.

URI

annotation/survey_response/read

Accessibility

Campaign supervisors may read their own annotations on survey responses.

Input Parameters

  • (r) auth_token = authentication token.
  • (r) client = the ubiquitous client parameter
  • (r) survey_id = indicates which the survey to retrieve annotations from

Example survey response annotation read POST

POST /app/annotation/survey_response/read HTTP/1.1
 Host: dev.ohmage.org
 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
 Content-Length: byte-length-of-content
 Content-Type: application/x-www-form-urlencoded

 auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26
 &client=ohmage.gwt
 &survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0

cURL Example

curl -v -d "auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26&client=omh.dvu.ptsd&survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0" http://localhost:8080/app/annotation/survey_response/read

Output Format

Success

{
    "result": "success",
    "data": [
        {
            "annotation_id": "16c78aa2-0ebb-48cb-8e79-2bc4dd156042",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        },
        {
            "annotation_id": "18f9f0ff-8bca-4a96-82eb-4b27b79053a2",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        },
        {
            "annotation_id": "0231bc4a-f4f2-42fe-9a34-98acb4df2694",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        },
        {
            "annotation_id": "410eb233-c489-470b-8d21-2fde7d62967d",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        }
    ]
}

Failure

See the error page for a description of error codes and their associated descriptions.

↑ Back to Top

What does it do?

Allows users to create annotations on prompt responses.

URI

annotation/prompt_response/create

Accessibility

Campaign supervisors may create prompt response annotations for all participants in their campaigns.

Input Parameters

  • (r) auth_token = authentication token.
  • (r) client = the ubiquitous client parameter
  • (r) survey_id = the id of the survey to be annotated
  • (r) prompt_id = the id of the prompt to be annotated
  • (o) repeatable_set_id = the id of the repeatable set containing the prompt
  • (o) repeatable_set_iteration = the iteration of the repeatable set
  • (r) time = the UNIX epoch milliseconds at which this annotation was created
  • (r) timezone = the timezone ID in which this annotation was created
  • (r) annotation = the annotation text.

Example prompt response annotation creation POST

POST /app/annotation/prompt_response/create HTTP/1.1
 Host: dev.ohmage.org
 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
 Content-Length: byte-length-of-content
 Content-Type: application/x-www-form-urlencoded

 auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26
 &client=omh.dvu.ptsd
 &survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0
 &prompt_id=overallMood
 &annotation=annotation text here
 &time=1328312397
 &timezone=GMT

cURL Example

curl -v -d "auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26&client=omh.dvu.ptsd&survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0&time=1328312397&prompt_id=overallMood&annotation=annotation text&time=1328312397&timezone=GMT" http://localhost:8080/app/annotation/prompt_response/create

Output Format

Success

{
   "result" : "success",
   "id" : "89a206c6-4ec1-11e1-a26e-e4ce8f075a7e"
}

Failure

See the error page for a description of error codes and their associated descriptions.

↑ Back to Top

What does it do?

Allows supervisors in campaigns to read their annotations on participant prompt responses.

URI

annotation/prompt_response/read

Accessibility

Campaign supervisors may read their own annotations on prompt responses.

Input Parameters

  • (r) auth_token = authentication token.
  • (r) client = the ubiquitous client parameter
  • (r) survey_id = indicates which the survey to retrieve annotations from
  • (r) prompt_id = the id of the prompt to retrive annotations from
  • (o) repeatable_set_id = the id of the repeatable set containing the prompt
  • (o) repeatable_set_iteration = the iteration of the repeatable set

Example prompt response annotation read POST

POST /app/annotation/prompt_response/read HTTP/1.1
 Host: dev.ohmage.org
 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
 Content-Length: byte-length-of-content
 Content-Type: application/x-www-form-urlencoded

 auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26
 &client=ohmage.gwt
 &survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0
 $prompt_id=overallMood

cURL Example

curl -v -d "auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26&client=omh.dvu.ptsd&survey_id=a299df12-24c6-4e79-bb09-2563b62d1df0&prompt_id=overallMood" http://localhost:8080/app/annotation/prompt_response/read

Output Format

Success

{
    "result": "success",
    "data": [
        {
            "annotation_id": "16c78aa2-0ebb-48cb-8e79-2bc4dd156042",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        },
        {
            "annotation_id": "18f9f0ff-8bca-4a96-82eb-4b27b79053a2",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        },
        {
            "annotation_id": "0231bc4a-f4f2-42fe-9a34-98acb4df2694",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        },
        {
            "annotation_id": "410eb233-c489-470b-8d21-2fde7d62967d",
            "timezone": "GMT-08:00",
            "time": 1329355972,
            "text": "text",
            "author": "bob.vance"
        }
    ]
}

Failure

See the error page for a description of error codes and their associated descriptions.

↑ Back to Top

What does it do?

Allows users to update annotation text for a specific annotation.

URI

annotation/update

Accessibility

Campaign supervisors may update their own annotations. Admins may update any annotation.

Input Parameters

  • (r) auth_token = authentication token.
  • (r) client = the ubiquitous client parameter
  • (r) annotation_id = indicates the annotation to update
  • (r) time = the UNIX epoch milliseconds at which this annotation was created
  • (r) timezone = the timezone ID in which this annotation was created
  • (r) annotation = the updated annotation text

Example prompt response annotation read POST

POST /app/annotation/update HTTP/1.1
 Host: dev.ohmage.org
 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
 Content-Length: byte-length-of-content
 Content-Type: application/x-www-form-urlencoded

 auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26
 &client=ohmage.gwt
 &annotation_id=a299df12-24c6-4e79-bb09-2563b62d1df0
 &time=1333044825
 &timezone=America/Los_Angeles
 &annotation=This is the updated annotation text

cURL Example

curl -v -d "auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26&client=omh.dvu.ptsd&annotation_id=a299df12-24c6-4e79-bb09-2563b62d1df0&time=1333044825&timezone=America/Los_Angeles&annotation=This is the updated annotation text" http://localhost:8080/app/annotation/update

Output Format

Success

{
    "result": "success",
}

Failure

See the error page for a description of error codes and their associated descriptions.

↑ Back to Top

What does it do?

Allows users to delete a specific annotation.

URI

annotation/delete

Accessibility

Campaign supervisors may delete their own annotations. Admins may delete any annotation.

Input Parameters

  • (r) auth_token = authentication token.
  • (r) client = the ubiquitous client parameter
  • (r) annotation_id = indicates the annotation to delete

Example prompt response annotation read POST

POST /app/annotation/delete HTTP/1.1
 Host: dev.ohmage.org
 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
 Content-Length: byte-length-of-content
 Content-Type: application/x-www-form-urlencoded

 auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26
 &client=ohmage.gwt
 &annotation_id=a299df12-24c6-4e79-bb09-2563b62d1df0

cURL Example

curl -v -d "auth_token=02c59bf6-65a2-478e-bcb4-675b543ace26&client=omh.dvu.ptsd&annotation_id=a299df12-24c6-4e79-bb09-2563b62d1df0 http://localhost:8080/app/annotation/delete

Output Format

Success

{
    "result": "success",
}

Failure

See the error page for a description of error codes and their associated descriptions.

↑ Back to Top