communications-mining
latest
false
UiPath logo, featuring letters U and I in white
Communications Mining Developer Guide
Last updated Nov 19, 2024

Reset a stream

docs image
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/reset/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/reset

Permissions required: Consume streams, View labels.

  • Bash
    curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "to_comment_created_at": "2020-06-03T16:05:00"
    }'curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "to_comment_created_at": "2020-06-03T16:05:00"
    }'
  • Node
    const request = require("request");
    
    request.post(
      {
        url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: { to_comment_created_at: "2020-06-03T16:05:00" },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );const request = require("request");
    
    request.post(
      {
        url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: { to_comment_created_at: "2020-06-03T16:05:00" },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );
  • Python
    import json
    import os
    
    import requests
    
    response = requests.post(
        "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={"to_comment_created_at": "2020-06-03T16:05:00"},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))import json
    import os
    
    import requests
    
    response = requests.post(
        "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={"to_comment_created_at": "2020-06-03T16:05:00"},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Response
    {
      "sequence_id": "4LvtenIBAAA=",
      "status": "ok",
      "stream": {
        "created_at": "2019-08-03T12:30:00.123456Z",
        "dataset_id": "abcdef0123456789",
        "description": "Used by ACME RPA to create tickets for disputes.",
        "id": "0123456789abcdef",
        "model": {
          "version": 8
        },
        "name": "dispute",
        "title": "Collateral Disputes",
        "updated_at": "2019-08-03T12:30:00.123456Z"
      }
    }{
      "sequence_id": "4LvtenIBAAA=",
      "status": "ok",
      "stream": {
        "created_at": "2019-08-03T12:30:00.123456Z",
        "dataset_id": "abcdef0123456789",
        "description": "Used by ACME RPA to create tickets for disputes.",
        "id": "0123456789abcdef",
        "model": {
          "version": 8
        },
        "name": "dispute",
        "title": "Collateral Disputes",
        "updated_at": "2019-08-03T12:30:00.123456Z"
      }
    }
A stream can be reset to move its position backwards or forwards in time, either to repeat previously returned comments or to skip comments. The timestamp used to reset a stream refers to the time the comments were uploaded (i.e. the comment's created_at property, rather than its timestamp property).
NAMETYPEREQUIREDDESCRIPTION
to_comment_created_atstringyesA ISO-8601 timestamp.
The response will contain the sequence_id corresponding to the new stream position.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.