<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/95251#M39064</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102562"&gt;@ErikJ&lt;/a&gt;&amp;nbsp;I ran into a similar issue before—it was like calling the wrong twin by their sibling’s name! Instead of using &lt;STRONG&gt;job_parameters&lt;/STRONG&gt;, I accidentally charmed my way through with &lt;STRONG&gt;notebook_params&lt;/STRONG&gt;, and voila, it worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;params = {
    "job_id": 12312312,
    "notebook_params": {
        "param1": "12",
        "param2": "test"
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, lesson learned: If something isn’t working, maybe it’s not a bug—it’s just your parameters playing hide-and-seek. Always good to try the other twin!&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2024 12:40:18 GMT</pubDate>
    <dc:creator>Panda</dc:creator>
    <dc:date>2024-10-21T12:40:18Z</dc:date>
    <item>
      <title>Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/93607#M38734</link>
      <description>&lt;P&gt;Hello! I have been using the databricks rest api&amp;nbsp;for running workflows using this endpoint:&amp;nbsp;&lt;SPAN&gt;/api/2.1/jobs/run-now. But now i wanted to also include job_parameters in my api call, i have put job parameters inside my workflow: param1, param2, and in my call to the api im sending this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;params ={"job_id" : 12312312&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"job_parameters":{"param1":"12",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"param2":"test"},&lt;/SPAN&gt;&lt;SPAN&gt;}. But for some reason i get following response:&amp;nbsp;&amp;nbsp;{'error_code': 'MALFORMED_REQUEST', 'message': "Could not parse request object: Expected 'START_OBJECT' not 'VALUE_STRING'\n at....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Anyone knows what the problem may be? Ive also just copied the sample request as specified in documentation:&lt;A href="https://docs.databricks.com/api/azure/workspace/jobs/runnow#job_parameters" target="_blank"&gt;https://docs.databricks.com/api/azure/workspace/jobs/runnow#job_parameters&lt;/A&gt;&amp;nbsp;but its not working either.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 10:10:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/93607#M38734</guid>
      <dc:creator>ErikJ</dc:creator>
      <dc:date>2024-10-11T10:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/93637#M38739</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102562"&gt;@ErikJ&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you sending a POST request to the /api/2.1/jobs/run-now endpoint? It's important to use a POST request because this endpoint expects the parameters to be included in the request body as JSON, not as query parameters.&lt;/P&gt;&lt;P&gt;Also, your "params" seem malformed, with a missing comma after "job_id": 12312312 and an extra comma after "job_parameters". This might just be due to copy-pasting, but incorrect JSON formatting can cause the MALFORMED_REQUEST error you're seeing.&lt;/P&gt;&lt;P&gt;Here's how your JSON body should look:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "job_id" : 12312312,
  "job_parameters":
  {
     "param1":"12",
     "param2":"test"
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Additional Notes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Ensure Correct HTTP Headers: Make sure you're setting the Content-Type header to application/json in your POST request.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Validate Your JSON: It's a good idea to validate your JSON payload using an online JSON validator to catch any syntax errors.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 11 Oct 2024 15:03:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/93637#M38739</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-10-11T15:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/93856#M38774</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
    "job_id": ,
    "job_parameters": {
        "params1": "",
        "params2": ""
    }
}&lt;/LI-CODE&gt;&lt;P&gt;Yes my bad maybe, but it is correctly formatted, and im using POST exactly as described in the databricks rest api documentation. I even copied their example json but that didn't help. I just know that, i can run the job using api, but as soon as i add parameters inside "job_parameters" i get this in return. But I will look into it today!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 10:42:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/93856#M38774</guid>
      <dc:creator>ErikJ</dc:creator>
      <dc:date>2024-10-14T10:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/94945#M39006</link>
      <description>&lt;P&gt;I just had the same error. The cause of the problem for me was that I didn't have depends_on formatted corretly. This may not be the same problem for you, but it might be worth checking similar things. The good news is that it won't spoil your adventure with any unwanted hints in the error message.&lt;BR /&gt;&lt;BR /&gt;I was using: "depends_on": ["A"]&lt;BR /&gt;It was fixed by switching to:&amp;nbsp;&lt;SPAN&gt;"depends_on"&lt;/SPAN&gt;&lt;SPAN&gt;: [{&lt;/SPAN&gt;&lt;SPAN&gt;"task_key"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"A"&lt;/SPAN&gt;&lt;SPAN&gt;}]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 19:37:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/94945#M39006</guid>
      <dc:creator>RyanBarrus</dc:creator>
      <dc:date>2024-10-18T19:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/95251#M39064</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102562"&gt;@ErikJ&lt;/a&gt;&amp;nbsp;I ran into a similar issue before—it was like calling the wrong twin by their sibling’s name! Instead of using &lt;STRONG&gt;job_parameters&lt;/STRONG&gt;, I accidentally charmed my way through with &lt;STRONG&gt;notebook_params&lt;/STRONG&gt;, and voila, it worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;params = {
    "job_id": 12312312,
    "notebook_params": {
        "param1": "12",
        "param2": "test"
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, lesson learned: If something isn’t working, maybe it’s not a bug—it’s just your parameters playing hide-and-seek. Always good to try the other twin!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 12:40:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/95251#M39064</guid>
      <dc:creator>Panda</dc:creator>
      <dc:date>2024-10-21T12:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/95255#M39065</link>
      <description>&lt;P&gt;notebook_params is deprecated in api 2.1:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/jobs/runnow" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/runnow&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 12:59:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/95255#M39065</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-10-21T12:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/95262#M39066</link>
      <description>&lt;P&gt;Hello and thank you for the replies! I found the issue. For some reason I had params = params in my requests.post(), but I swapped to json = params like this:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;requests.&lt;/SPAN&gt;&lt;SPAN&gt;post&lt;/SPAN&gt;&lt;SPAN&gt;(url, &lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;headers,&lt;/SPAN&gt;&lt;SPAN&gt;json&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;params).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Oct 2024 13:06:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/95262#M39066</guid>
      <dc:creator>ErikJ</dc:creator>
      <dc:date>2024-10-21T13:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Errors calling databricks rest api /api/2.1/jobs/run-now with job_parameters</title>
      <link>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/106003#M42339</link>
      <description>&lt;P&gt;I encountered a null job_id in my post, when a notebook parameter was set in the job GUI. But it runs just fine (I get a valid job_id with active run) if I delete the notebook parameter in the job GUI.&lt;BR /&gt;&lt;BR /&gt;Is this a documented behavior, or a bug? If it's expected, where is this documented?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 00:28:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/errors-calling-databricks-rest-api-api-2-1-jobs-run-now-with-job/m-p/106003#M42339</guid>
      <dc:creator>slkdfuba</dc:creator>
      <dc:date>2025-01-17T00:28:08Z</dc:date>
    </item>
  </channel>
</rss>

