Skip to main content

Edit Job

Use this API to:

  • Add or remove slicer or filter values from your job.
    • For a given set of slicers, please refer "userReportGenerationFilterData" in the json.
  • Customize your email
  • To edit slicers/filters, please refer to "userReportGenerationFilterData" in the json.
tip

Than constructing the entire payload, do a GET job details call, capture the payload, make changes to the payload and do a PUT call to edit the job.

Endpoint#

URL: https://portal.bihelper.tech/api/user-jobs/Method: PUT

Headers#

KeyValueDescription
AuthorizationBearer Auth_TokenAuth token
Content-Typeapplication/json
User-Agentcurl/7.68.0Set user agent header

Request Body#

{    "id": 3,    "name": "Retail Sales Report",    "isActive": true,    "lastRun": "2021-04-08T11:15:28",    "nextRun": "2021-05-08T11:16:00",    "timeZone": "Asia/Kolkata",    "status": "RUNNING",    "jobDuration": 0,    "jobRunFrequency": "MONTHLY",    "userJobStartTime": "2019-10-08T16:46:00",    "userId": 6,    "userReportGenerationTasks": [        {            "id": 3,            "name": "NOT CONFIGURED",            "isActive": true,            "lastRun": null,            "nextRun": null,            "timeZone": "America/New_York",            "status": "READY",            "jobDuration": null,            "userWorkspace": "My workspace",            "userWorkspaceId": "MY_WORKSPACE",            "userReportName": "Retail Sales Report",            "reportType": "REPORTS",            "generateSamples": false,            "userJobId": 3,            "pbiUserName": "Deprecated",            "pbiPassword": "Deprecated",            "reportRunPeriod": "LAST_MONTH",            "scriptName": "BH_PBI_PDF_ENGINE_3",            "filePrefix": "",            "reportUrl": "https://app.powerbi.com/reportEmbed?reportId=db9a2770-75de-492a-827f-be2a78c8af78&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly9XQUJJLUlORElBLUNFTlRSQUwtQS1QUklNQVJZLXJlZGlyZWN0LmFuYWx5c2lzLndpbmRvd3MubmV0IiwiZW1iZWRGZWF0dXJlcyI6eyJtb2Rlcm5FbWJlZCI6ZmFsc2V9fQ%3d%3d",            "dataIngestionMode": "MANUAL",            "numberOfLoops": 10,            "timeout": 30,            "transparentBackground": true,            "pagesToPrint": "All",            "pageSize": "1280*720",            "generateExcel": true,            "listOfExcelVisuals": "All",            "shouldPDFBeGenerated": true,            "reportDateField": null,            "biTool": "POWER_BI",            "userReportGenerationFilterData": [                {                    "id": 82457,                    "startDate": null,                    "endDate": null,                    "isActive": true,                    "filterName": "District Manager <> Store/DM",                    "filterValue": "Tina Lassila",                    "contacts": "ishan@bihelper.tech",                    "toEmail": "ishan@bihelper.tech",                    "ccEmail": "kiran@bihelper.tech",                    "bccEmail": null,                    "userReportGenerationTasksId": 3                },                {                    "id": 82458,                    "startDate": null,                    "endDate": null,                    "isActive": true,                    "filterName": "District Manager <> Store/DM",                    "filterValue": "Andrew Ma",                    "contacts": "ishan@bihelper.tech;",                    "toEmail": "ishan@bihelper.tech",                    "ccEmail": null,                    "bccEmail": "kiran@bihelper.tech",                    "userReportGenerationTasksId": 3                },                {                    "id": 82459,                    "startDate": "2019-04-11T10:35:28",                    "endDate": "2019-04-11T10:35:28",                    "isActive": true,                    "filterName": "District Manager <> Store/DM",                    "filterValue": "Allan Guinot",                    "contacts": "ishan@bihelper.tech; kiran@bihelper.tech",                    "toEmail": "ishan@bihelper.tech; kiran@bihelper.tech",                    "ccEmail": null,                    "bccEmail": null,                    "userReportGenerationTasksId": 3                },                {                    "id": 82460,                    "startDate": "2019-11-27T11:35:26",                    "endDate": "2019-11-27T11:35:26",                    "isActive": true,                    "filterName": "District Manager <> Store/DM",                    "filterValue": "Chris Gray",                    "contacts": "",                    "toEmail": "kiran@bihelper.tech",                    "ccEmail": "kiran@vegasolutions.in",                    "bccEmail": null,                    "userReportGenerationTasksId": 3                }            ]        }    ],    "userEmailTasks": [        {            "id": 3,            "name": "Email Task Default Name",            "isActive": true,            "lastRun": null,            "nextRun": null,            "timeZone": "America/New_York",            "status": "READY",            "jobDuration": null,            "taskRunTime": null,            "userJobId": 3,            "fromEmail": "BI Helper Demo <demo@bihelper.tech>",            "isEmailVerified": true,            "clientEmailTemplateName": null,            "testCampaign": false,            "emailTitle": "BI Helper - Retail Sales Report",            "emailBody": "<div>Hi,</div><div><br></div><div>Welcome to BI Helper! Your Retail Sales Report, sliced by District Manager and Time Period is enclosed. Here are some great new features in BI Helper:</div><div><br></div><ol><li>Select the Power BI report pages you want to print as PDFs.</li><li>Define page sizes in BI Helper to match those in your Power BI report tabs.</li><li>Select your matrix and table visuals for export to Excel and email them to your users along with the PDFs.</li></ol><div><br></div><div><span style=\"color: black;\">For more information, mail </span><a href=\"mailto:kiran@bihelper.tech\" target=\"_blank\" style=\"color: black;\">kiran@bihelper.tech</a><span style=\"color: black;\">&nbsp;or </span><a href=\"mailto:ishan@bihelper.tech\" target=\"_blank\" style=\"color: black;\">ishan@bihelper.tech</a><span style=\"color: black;\">. We'd love to hear from you.&nbsp;</span></div><div><br></div><div>Thank you,</div><div><br></div><div><img src=\"https://s3.amazonaws.com/bihelperresources/images/logo.png\" width=\"101\"></div><div><br></div><div><strong><em>Serving clients in EU, US, UK and SA!</em></strong></div>",            "emailSignature": "Thank you,<br /><img src=\"https://s3.amazonaws.com/bihelperresources/images/logo.png\" alt=\"B.I. Helper\"  style=\"width:100px\"/>"        }    ]}

Curl Request#


curl --location --request PUT 'https://portal.bihelper.tech/api/user-jobs' \--header 'Authorization: Bearer Auth_Token' \--header 'Content-Type: application/json' \--header 'User-Agent: curl/7.68.0' \--data-raw '{    "id": 443,    "name": "API Demo Job",    ...... {Rest of the body}}'

Response#

Sample response:

{  "id": 443,  "name": "API Demo Job",  "isActive": true,  "lastRun": null,  "nextRun": "2020-05-20T19:58:16",  "timeZone": "Etc/GMT",  "status": "READY",  "jobDuration": 0,  "jobRunFrequency": "MONTHLY",  "userJobStartTime": "2020-05-20T19:58:16",  "userId": 6,  "userReportGenerationTasks": [    {      "id": 433,      "name": "NOT CONFIGURED",      "isActive": true,      "lastRun": null,      "nextRun": null,      "timeZone": "America/New_York",      "status": null,      "jobDuration": null,      "userWorkspace": "My workspace",      "userWorkspaceId": "MY_WORKSPACE",      "userReportName": "Retail Sales Report",      "reportType": "REPORTS",      "generateSamples": false,      "userJobId": 443,      "pbiUserName": " ",      "pbiPassword": " ",      "reportRunPeriod": "LAST_MONTH",      "scriptName": "NewJob_443",      "filePrefix": "Retail Sales Report",      "reportUrl": "https://app.powerbi.com/reportEmbed?reportId=db9a2770-75de-492a-827f-be2a78c8af78&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly9XQUJJLUlORElBLUNFTlRSQUwtQS1QUklNQVJZLXJlZGlyZWN0LmFuYWx5c2lzLndpbmRvd3MubmV0IiwiZW1iZWRGZWF0dXJlcyI6eyJtb2Rlcm5FbWJlZCI6ZmFsc2V9fQ%3d%3d",      "dataIngestionMode": "MANUAL",      "numberOfLoops": 10,      "timeout": 30,      "transparentBackground": false,      "pagesToPrint": "All",      "pageSize": "1280*720",      "generateExcel": false,      "listOfExcelVisuals": "All",      "shouldPDFBeGenerated": true,      "reportDateField": null,      "userReportGenerationFilterData": [        {          "id": 50328,          "startDate": null,          "endDate": null,          "isActive": true,          "filterName": "District Manager <> Store/DM",          "filterValue": "Andrew Ma",          "contacts": null,          "toEmail": "ishan@bihelper.tech",          "ccEmail": null,          "bccEmail": null,          "userReportGenerationTasksId": 433        },        {          "id": 50329,          "startDate": "2020-06-24T02:55:51",          "endDate": "2020-06-24T02:55:51",          "isActive": true,          "filterName": "District Manager <> Store/DM",          "filterValue": "Allan Guinot",          "contacts": "",          "toEmail": "ishan@bihelper.tech",          "ccEmail": null,          "bccEmail": null,          "userReportGenerationTasksId": 433        }      ]    }  ],  "userEmailTasks": [    {      "id": 426,      "name": "Email Task Default Name",      "isActive": true,      "lastRun": null,      "nextRun": null,      "timeZone": "America/New_York",      "status": null,      "jobDuration": null,      "taskRunTime": null,      "userJobId": 443,      "fromEmail": "BI Helper Demo <demo@bihelper.tech>",      "isEmailVerified": true,      "clientEmailTemplateName": null,      "testCampaign": false,      "emailTitle": "BI Helper Report",      "emailBody": "<div>Hi,</div><div><br></div><div>Please find attached a PDF of your report <strong>without</strong> any slicers or filters applied.</div><div><br></div><div>To add slicers or filters to your report, please refer to the following documents:</div><div><br></div><ul><li><a href=\"https://medium.com/bi-helper/tutorial-configure-a-power-bi-report-with-slicers-and-filters-9d51629c57e2\" target=\"_blank\">Configure your BI Helper job with slicers or filters</a></li><li><a href=\"https://bihelperresources.s3.amazonaws.com/documentation/BI+Helper+-+Product+Documentation.pdf\" target=\"_blank\">Product Guide</a></li></ul><div><br></div><div>For any assistance, please email contact@bihelper.tech</div><div><br></div><div>Thank you,</div><div><img src=\"https://s3.amazonaws.com/bihelperresources/images/logo.png\" width=\"101\"></div>",      "emailSignature": null    }  ]}