目录

Replying to Comments

Use Cases

Drive Kit allows your app to provide the reply function for users, including adding, viewing, updating, and deleting replies to comments on files in the cloud.

Creating a Reply

Introduction

Creates a reply to a comment using the Replies.create API.

Restrictions

Sending a Request to Reply to a Comment

  1. Create a POST request to the Replies.create API.
  2. Set the query parameters fileId, commentId, and fields.

    Example:

    POST https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId}/replies?fields=*

  3. Set HTTP header fields.

    • Accept: media type that is acceptable for the response.
    • Content-Type: media type of the request.
    • Cache-Control: directives to be obeyed by the caching mechanism.
    • Authorization: authorization code obtained from the HUAWEI Account server.

  4. Send the request.

    Request example:
    POST https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY/replies?fields=* HTTP/1.1 
    Accept: application/json 
    Content-Type: application/json 
    Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk 
    Cache-Control: no-cache 
    
    { 
        "description":"HuaweiTest001",
        "operate":"reopen"
    }

    Response example:

    HTTP/1.1 200 OK 
    {
        "creator": {
            "permissionId": "299639512454136576",
            "displayName": "*******3121@**3.com",
            "me": true,
            "category": "drive#user"
        },
        "editedTime": "2020-02-19T13:49:32.862Z",
        "operate": "reopen",
        "deleted": false,
        "createdTime": "2020-02-19T13:49:32.862Z",
        "description": "HuaweiTest001",
        "id": "BpMy9fyvWDfDM2rRKzfpNbqDkNfOnVg7w",
        "category": "drive#reply",
        "htmlDescription": "HuaweiTest001"
    }

Retrieving a Reply

Introduction

Obtains a reply to a comment using the Replies.get API.

Restrictions

Sending a Request to Obtain a Reply

  1. Create a GET request to the Replies.get API.
  2. Set the query parameters fileId, commentId, replyId, and fields.

    Example:

    GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId}/replies/{replyId}?fields=*

  3. Set HTTP header fields.

    • Accept: media type that is acceptable for the response.
    • Cache-Control: directives to be obeyed by the caching mechanism.
    • Authorization: authorization code obtained from the HUAWEI Account server.

  4. Send the request.

    Request example:
    GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY/replies/BpMy9fyvWDfDM2rRKzfpNbqDkNfOnVg7w?fields=* HTTP/1.1 
    Accept: application/json 
    Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk 
    Cache-Control: no-cache 

    Response example:

    HTTP/1.1 200 OK 
    {
        "creator": {
            "permissionId": "299639512454136576",
            "displayName": "*******3121@**3.com",
            "me": true,
            "category": "drive#user"
        },
        "editedTime": "2020-02-19T13:49:32.862Z",
        "operate": "reopen",
        "deleted": false,
        "createdTime": "2020-02-19T13:49:32.862Z",
        "description": "HuaweiTest001",
        "id": "BpMy9fyvWDfDM2rRKzfpNbqDkNfOnVg7w",
        "category": "drive#reply",
        "htmlDescription": "HuaweiTest001"
    }

Listing Replies to a Comment

Introduction

Lists all replies to a comment using the Replies.list API. You can set the pageSize parameter to specify the number of replies to be displayed on each page.

Restrictions

Note

Currently, the includeDeleted parameter is not used.

Sending a Request to List Replies

  1. Create a GET request to the Replies.list API.
  2. Set the query parameters fileId, commentId, and fields.

    Example:

    GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId}/replies?fields=*

  3. Set HTTP header fields.

    • Accept: media type that is acceptable for the response.
    • Cache-Control: directives to be obeyed by the caching mechanism.
    • Authorization: authorization code obtained from the HUAWEI Account server.

  4. Send the request.

    Request example:
    GET https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY/replies?fields=* HTTP/1.1 
    Accept: application/json 
    Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk 
    Cache-Control: no-cache 

    Response example:

    HTTP/1.1 200 OK 
    {
        "nextCursor": "BCCDAB44ACDFA4D6EA0E435F3A7560EF0",
        "replies": [
            {
                "creator": {
                    "permissionId": "299639512454136576",
                    "displayName": "*******3121@**3.com",
                    "me": true,
                    "category": "drive#user"
                },
                "editedTime": "2020-02-19T13:56:31Z",
                "operate": "reopen",
                "deleted": false,
                "createdTime": "2020-02-19T13:56:31Z",
                "description": "HuaweiTest003",
                "id": "Bv_vRsfoUCBJmbCvafSFNQrvTWT12lAsS",
                "category": "drive#reply",
                "htmlDescription": "HuaweiTest003"
            },
            {
                "creator": {
                    "permissionId": "299639512454136576",
                    "displayName": "*******3121@**3.com",
                    "me": true,
                    "category": "drive#user"
                },
                "editedTime": "2020-02-19T13:56:26Z",
                "operate": "reopen",
                "deleted": false,
                "createdTime": "2020-02-19T13:56:26Z",
                "description": "HuaweiTest002",
                "id": "BvGxpclcpKkC2hMquGAZI4bhE4f7bqSlA",
                "category": "drive#reply",
                "htmlDescription": "HuaweiTest002"
            },
            {
                "creator": {
                    "permissionId": "299639512454136576",
                    "displayName": "*******3121@**3.com",
                    "me": true,
                    "category": "drive#user"
                },
                "editedTime": "2020-02-19T13:49:33Z",
                "operate": "reopen",
                "deleted": false,
                "createdTime": "2020-02-19T13:49:33Z",
                "description": "HuaweiTest001",
                "id": "BpMy9fyvWDfDM2rRKzfpNbqDkNfOnVg7w",
                "category": "drive#reply",
                "htmlDescription": "HuaweiTest001"
            }
        ],
        "category": "drive#replyList"
    }

Deleting a Reply

Introduction

Deletes a reply to a comment using the Replies.delete API.

Restrictions

Sending a Request to Delete a Reply

  1. Create a DELETE request to the Replies.delete API.
  2. Set the query parameters fileId, commentId, and replyId.

    Example:

    DELETE https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId}/replies/{replyId}

  3. Set HTTP header fields.

    • Cache-Control: directives to be obeyed by the caching mechanism.
    • Authorization: authorization code obtained from the HUAWEI Account server.

  4. Send the request.

    Request example:
    DELETE https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY/replies/BpMy9fyvWDfDM2rRKzfpNbqDkNfOnVg7w HTTP/1.1 
    Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk 
    Cache-Control: no-cache 

    Response example:

    HTTP/1.1 204 OK

Modifying a Reply

Introduction

Updates a reply to a comment using the Replies.update API.

Restrictions

Sending a Request to Update a Reply

  1. Create a PATCH request to the Replies.update API.
  2. Set the query parameters fileId, commentId, replyId, and fields.

    Example:

    PATCH https://driveapis.cloud.huawei.com.cn/drive/v1/files/{fileId}/comments/{commentId}/replies/{replyId}?fields=*

  3. Set HTTP header fields.

    • Accept: media type that is acceptable for the response.
    • Content-Type: media type of the request.
    • Cache-Control: directives to be obeyed by the caching mechanism.
    • Authorization: authorization code obtained from the HUAWEI Account server.

  4. Send the request.

    Request example:
    PATCH https://driveapis.cloud.huawei.com.cn/drive/v1/files/AAAB9Wn0DTQCIqPbW9avGjAQo9dbxg04A/comments/BkytC_85-y5hoiLxCRnNCHZcDynNC_siY/replies/BpMy9fyvWDfDM2rRKzfpNbqDkNfOnVg7w?fields=* HTTP/1.1 
    Accept: application/json 
    Content-Type: application/json 
    Authorization: Bearer CV3PnPLZXyr9K2GV7RYZkF962JZvoEkMQhTho3QHQAPQUyma/lEyZskP/IMWrc7FvaeHivO7y0lyibI/fQvulBnTgtXArSVPsjaLKvYNkDsJSaIR2/sx+K40bYDWWpKFvJNKg2U47jRwz2mfiF3ortNk 
    Cache-Control: no-cache 
    
    { 
        "description":"HuaweiTest011",
        "operate":"reopen"
    }

    Response example:

    HTTP/1.1 200 OK 
    {
        "creator": {
            "permissionId": "299639512454136576",
            "displayName": "*******3121@**3.com",
            "me": true,
            "category": "drive#user"
        },
        "editedTime": "2020-02-19T13:49:32.862Z",
        "operate": "reopen",
        "deleted": false,
        "createdTime": "2020-02-19T13:49:32.862Z",
        "description": "HuaweiTest011",
        "id": "BpMy9fyvWDfDM2rRKzfpNbqDkNfOnVg7w",
        "category": "drive#reply",
        "htmlDescription": "HuaweiTest001"
    }