GitHub user vimalgalani28 created a discussion: Getting 400 when using airflow 
rest api to trigger airflow dag

I am using airflow version 2.9.2 and trying to trigger dag using airflow rest 
api. PFA curl:
```
curl --request POST \
  --url http://localhost:9000/api/v1/dags/test_dag/dagRuns \
  --header 'Authorization: Basic token' \
  --header 'Content-Type: application/json' \
  --data '{
        "conf": {
                "version": "1"
        }
}'
```

Getting response as below:
```
{
        "detail": "{'run_id': ['Missing data for required field.'], 'dag_id': 
['Missing data for required field.'], 'run_type': ['Missing data for required 
field.'], 'logical_date': ['Unknown field.'], 'dag_run_id': ['Unknown 
field.']}",
        "status": 400,
        "title": "Bad Request",
        "type": 
"https://airflow.apache.org/docs/apache-airflow/2.9.2/stable-rest-api-ref.html#section/Errors/BadRequest";
}
```

I checked airflow server logs. It gives me error as below:
`│ <unknown>:160 SyntaxWarning: invalid escape sequence '\;'`

Checked airflow 
[docs](https://airflow.apache.org/docs/apache-airflow/2.9.2/stable-rest-api-ref.html#section/Errors/BadRequest).
 The only required field is conf and dag id in request param. Am I missing 
something?

GitHub link: https://github.com/apache/airflow/discussions/45539

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscr...@airflow.apache.org

Reply via email to