Link Search Menu Expand Document

PDF

Working with Comments

Platform API


To add or edit comments the UI, use the API POST method to add and PUT method to edit comments for an object. To retrieve a list of all comments for a specific object, use the GET method.


on this page


Adding a New Comment

To add a comment to an existing object:

  1. Open a terminal window on your system.

  2. Make the following POST API request to the OpenX server to add a comment to the selected object (in this case, a line item). Note that there is a 1000 character limit for a comment and a comment can be alphanumeric.

    curl -s -X POST 'http://qa-v2-i16-lmi.api-v4-qa-ca.openx.net/ox/4.0/comment' --cookie $COOKIE --header "Content-Type:application/json" -d '{"obj_type": "lineitem","obj_uid": "600738b9-c002-fff1-8123-0c9a66","text": "A comment on a lineitem"}' | python -mjson.tool
    

    For a list of values that make up the POST request to the OpenX server, see Comment Values.

  3. The OpenX server processes this POST API request and returns a response output similar to the example response shown below.

    [
        {
            "account_id": "1611253648",
            "account_uid": "6009c790-accf-fff1-8123-0c9a66",
            "created_date": "2019-10-15 20:58:39",
            "deleted": "0",
            "id": "1610638236",
            "instance_uid": "a505e730-0b7a-11e3-8ffd-0800200c9a66",
            "modified_date": "2019-10-15 20:58:39",
            "obj_id": "1611086009",
            "obj_type": "lineitem",
            "obj_uid": "600738b9-c002-fff1-8123-0c9a66",
            "revision": 1,
            "text": "A comment on a lineitem",
            "text_type": "text",
            "type": "comment",
            "uid": "6000639c-bbbb-fff1-8123-0c9a66",
            "user_id": "1610845423",
            "v": "3"
        }
    ]
    

    For a list of values returned in the response output from the OpenX server, see Response Values.


Editing an Existing Comment

To edit comments for an existing object:

  1. Open a terminal window on your system.

  2. Make the following PUT API request to the OpenX server to edit/update a comment to the selected object (in this case, a line item).

    $ curl -v -X PUT 'http://qa-v2-i16-lmi.api-v4-qa-ca.openx.net/ox/4.0/comment/1610638236'  -H "Content-Type:application/json" --cookie $COOKIE -d '{"text": "blah"}' | python -mjson.tool
    

    For a list of values that make up the PUT request to the OpenX server, see Comment Values.

  3. The OpenX server processes the PUT request and updates the comment for the specified object. The response returned from the server id similar to the example below.

    [
        {
            "account_id": "1611253648",
            "account_uid": "6009c790-accf-fff1-8123-0c9a66",
            "created_date": "2019-10-15 20:58:39",
            "deleted": "0",
            "id": "1610638236",
            "instance_uid": "a505e730-0b7a-11e3-8ffd-0800200c9a66",
            "modified_date": "2019-10-15 21:09:36",
            "obj_id": "1611086009",
            "obj_type": "lineitem",
            "obj_uid": "600738b9-c002-fff1-8123-0c9a66",
            "revision": 2,
            "text": "blah",
            "text_type": "text",
            "type": "comment",
            "uid": "6000639c-bbbb-fff1-8123-0c9a66",
            "user_id": "1610845423",
            "user_uid": "60038cef-acc0-fff1-8123-0c9a66",
            "v": "3"
        }
    ]
    

    For a list of values returned in the response output from the OpenX server, see Response Values.


Getting a List of Comments

To get a list of comments associated with an object by making a GET request to the OpenX Server:

  1. Open a terminal window on your system.

  2. Make the following GET request to the OpenX server (in this case, a line item):

    curl -v -X GET 'http://qa-v2-i16-lmi.api-v4-qa-ca.openx.net/ox/4.0/comment/1610638236'  -H "Content-Type:application/json"--cookie $COOKIE | python -mjson.tool
    

    For a list of values that make up the GET request to the OpenX server, see Comment Values.

  3. The OpenX server processes the GET request and returns a list of all comments for that specified comment. An example of a comment is shown below.

    [
        {
            "account_id":"1611253648",
            "account_uid":"6009c790-accf-fff1-8123-0c9a66",
            "created_date":"2019-10-15 20:58:39",
            "deleted": "0",
            "id":"1610638236",
            "instance_uid":"a505e730-0b7a-11e3-8ffd-0800200c9a66",
            "modified_date":"2019-10-15 20:58:39",
            "obj_id":"1611086009",
            "obj_type":"lineitem",
            "obj_uid":"600738b9-c002-fff1-8123-0c9a66",
            "revision":1,
            "text":"A comment on a lineitem",
            "text_type":"text",
            "type":"comment",
            "uid":"6000639c-bbbb-fff1-8123-0c9a66",
            "user_id":"1610845423",
            "user_uid":"60038cef-acc0-fff1-8123-0c9a66",
            "v": "3"
          }
    ]
    

    For a list of values returned in the response output from the OpenX server, see Response Values.


Comment Values

The values in the table below make up the request to the OpenX server.

ValueDescriptionExample
resource URLThe URL used to make the API request to the OpenX server.http://qa-v2-i16-lmi.api-v4-qa-ca.openx.net/ox/4.0/comment
cookieThe session cookie used in the header.$COOKIE
headerThe authentication header used to access the OpenX server.Content-Type:application/json\" -d
obj_typeThe type of object that the comment is being added to.lineitem
obj_uidThe unique identifier for the comment associated with the object.600738b9-c002-fff1-8123-0c9a66
textThe text added/edited for the comment.The text for the comment
NOTE

The GET method only uses the resource URL, cookie, and header values.


Response Values

The values listed in the table below are returned in the response output from the OpenX server.

ValueDescriptionExample
account_idA unique ID of the account.1611253648
account_uidThe unique identifier for the account, determined from account_id.6009c790-accf-fff1-8123-0c9a66
created_dateThe date/time when the comment was added to the object.2019-10-15 20:58:39
deletedA flag that specifies whether the comment has been deleted: 0 = FALSE 1 = TRUE.0
idThe unique identifier for the comment.1610638236
instance_uidThe platform_hash for the session.a505e730-0b7a-11e3-8ffd-0800200c9a66
modified_dateThe timestamp when the last change was made to the comment.2019-10-15 20:58:39
obj_idThe ID determined from obj_uid.1611086009
obj_typeThe type of object referred to by comment.lineitem
obj_uidThe unique identifier for the object.600738b9-c002-fff1-8123-0c9a66
revisionThe revision of the comment.1
textThe text that makes up the comment being added to the object.A comment on a lineitem
text_typeThe type of text used in the comment (for example, text, html).text
typeThe type of comment added to the object.comment
uidThe unique identifier for the comment.6000639c-bbbb-fff1-8123-0c9a66
user_idThe ID associated with the user who created the comment.1610845423
user_uidThe UID associated with the user who created the comment.200165d2-acc0-fff1-8123-0c9a66
vThe API version.3