communications-mining
latest
false
UiPath logo, featuring letters U and I in white

Communications Mining Developer Guide

Last updated Dec 20, 2024

Advance a stream

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

Permissions required: Consume streams, View labels.

  • Bash
    curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"
    }'curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"
    }'
  • Node
    const request = require("request");
    
    request.post(
      {
        url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: { sequence_id: "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR" },
      },
      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/advance",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: { sequence_id: "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR" },
      },
      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/advance",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={"sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"},
    )
    
    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/advance",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={"sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Response
    {
      "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR",
      "status": "ok"
    }{
      "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR",
      "status": "ok"
    }
Each fetch request returns a sequence_id which represents the position it has fetched up to. Passing that same sequence_id to the advance api will make sure that next time a fetch is performed on the stream it will start from this position. You can advance to the next batch by using the current batch's sequence_id. Alternatively, you can advance to the next comment by using the current comment's sequence_id.

Since an application can successfully process a comment but fail at the advance step, it is important to handle seeing a comment multiple times on the client application side.

NAMETYPEREQUIREDDESCRIPTION
sequence_idstringyesThe sequence ID to advance the stream to.

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.