comment object
Supports the logging of comments for any API object, such as via its Description field in the OpenX UI.
The comment
object has the following calls:
Call | Description |
---|---|
GET /comment | List all comments. |
GET /comment/available_fields | List the available_fields used to create or update a comment.See comment object example 1. |
GET /comment?obj_type=object_name&obj_uid=object_UID | Read the comments for the specified object. For example, GET /comment?obj_type=lineitem&obj_uid=60062525-c002-fff1-8123-0c9a66 |
POST /comment | Create one or more comments. See comment object example 2. |
PUT /comment/comment_UID | Update the comment specified by its ID or UID. |
Examples
Samples for the comment
object.
Example 1
Sample available_fields
response for the comment
object.
Expand example 1
{
"account_id": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "int"
},
"account_uid": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "account_uid"
},
"created_date": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "datetime"
},
"deleted": {
"auto": true,
"default": "0",
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "int"
},
"id": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "int"
},
"instance_uid": {
"auto": true,
"has_dependencies": false,
"maxlen": 255,
"readonly": true,
"required": false,
"type": "varchar"
},
"modified_date": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "datetime"
},
"obj_id": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "int"
},
"obj_type": {
"has_dependencies": false,
"maxlen": 255,
"readonly": false,
"required": true,
"type": "varchar",
"url": "/options/comment_obj_type_options"
},
"obj_uid": {
"has_dependencies": false,
"readonly": false,
"required": true,
"type": "uid"
},
"text": {
"has_dependencies": false,
"maxlen": 1000,
"readonly": false,
"required": true,
"type": "varchar"
},
"text_type": {
"default": "text",
"has_dependencies": false,
"maxlen": 255,
"readonly": false,
"required": true,
"type": "varchar",
"url": "/options/comment_text_type_options"
},
"type": {
"auto": true,
"has_dependencies": false,
"maxlen": 255,
"readonly": true,
"required": false,
"type": "varchar",
"url": "/options/model_types"
},
"uid": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "uid"
},
"user_id": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "int"
},
"user_uid": {
"auto": true,
"has_dependencies": false,
"readonly": true,
"required": false,
"type": "uid"
},
"v": {
"auto": true,
"default": "3",
"has_dependencies": false,
"options": [],
"readonly": true,
"required": false,
"type": "int"
}
}
Example 2
Sample POST
to create a comment for a specified line item.
Expand example 2
Request
curl -X POST --header "Content-Type: application/json" http://openx_server_name/ox/4.0/comment \
--cookie "openx3_access_token=token_string" \
--data='{
"obj_type": "lineitem",
"obj_uid": "60062525-c002-fff1-8123-0c9a66",
"text": "A comment on a lineitem"
}'
Response
[
{
"account_id": "537237799",
"account_uid": "20059927-accf-fff1-8123-0c9a66",
"created_date": "2015-03-26 00:06:47",
"deleted": "0",
"id": "536870938",
"instance_uid": "110d4d80-0c23-11e3-8ffd-0800200c9a66",
"modified_date": "2015-03-26 00:06:47",
"obj_id": "1611015461",
"obj_type": "lineitem",
"obj_uid": "60062525-c002-fff1-8123-0c9a66",
"revision": 1,
"text": "A comment on a line item",
"text_type": "text",
"type": "comment",
"uid": "2000001a-bbbb-fff1-8123-0c9a66",
"user_id": "536962514",
"user_uid": "200165d2-acc0-fff1-8123-0c9a66",
"v": "3"
}
]