GitHub user nrobinson-intelycare edited a comment on the discussion: Getting 
400 when using airflow rest api to trigger airflow dag

I was looking forward to using this to allow GitHub Actions to trigger DAG runs 
from the Airflow REST API, but I am getting the same error as @vimalgalani28 on 
Airflow v2.10.4, using Basic authentication:
https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/api-authentication.html#basic-authentication

Request with cURL:

```
curl --request POST \
--url http://AIRFLOW_HOST:8080/api/v1/dags/manual_dbt_airflow_run_batch/dagRuns 
\
--user 'API_USER:API_PASSWORD' \
-H 'Content-Type: application/json' \
-d '{}'
```


Response:
```
{
  "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.10.4/stable-rest-api-ref.html#section/Errors/BadRequest";
}
```

Here are the only logs I see for the request:
```
Jan 14 16:35:57 ip-10-105-6-62.ec2.internal airflow-webserver[172469]: 
[2025-01-14T16:35:57.526+0000] {override.py:1679} INFO - Updated user API User
Jan 14 16:35:57 ip-10-105-6-62.ec2.internal airflow-webserver[172469]: 
100.64.0.3 - API_USER [14/Jan/2025:16:35:57 +0000] "POST 
/api/v1/dags/manual_dbt_airflow_run_batch/dagRuns HTTP/1.1" 400 396 "-" 
"curl/8.7.1"
```

@potiuk Could we please reopen this discussion?

GitHub link: 
https://github.com/apache/airflow/discussions/45539#discussioncomment-11833854

----
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