UiPath Documentation
ixp
latest
false
Communications Mining user guide

Advance a stream

API reference for the stream advance endpoint, including required permissions and example curl requests.

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 a comment that appears multiple times on the client application side.

NAMETYPEREQUIREDDESCRIPTION
sequence_idstringyesThe sequence ID to advance the stream to.

Was this page helpful?

Connect

Need help? Support(opens in new window)

Want to learn? UiPath Academy(opens in new window)

Have questions? UiPath Forum(opens in new window)

Stay updated