Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unclear schema for created_at__range parameters #33

Open
atibaup opened this issue Jun 16, 2023 · 2 comments
Open

unclear schema for created_at__range parameters #33

atibaup opened this issue Jun 16, 2023 · 2 comments

Comments

@atibaup
Copy link

atibaup commented Jun 16, 2023

Hi,
I'm trying to use the

https://cloud.getdbt.com/api/v2/accounts/{account_id}/runs/

API to retrieve a list of runs.

I want to pass the created_at__range query parameter, but the documentation is not clear on what the expected format is (it only says array). Could you give me an example of how to pass that parameter to filter runs from say May 1st to June 1st of 2023?

thanks

@jzamanxometry
Copy link

+1

@mjsqu
Copy link

mjsqu commented Sep 11, 2023

After a bit of experimentation:

/api/v2/accounts/1/runs/?created_at__range=["2023-09-01%2001:41:25.194395%2000:00","2023-09-11%2000:41:25.194395%2000:00"]

curl 'https://${YOUR_URI_HERE}/api/v2/accounts/1/runs/?created_at__range=\[%222023-09-01%2001:41:25.194395%2000:00%22,%222023-09-11%2000:41:25.194395%2000:00%22\]'

Achieved by extracting a few records using: /api/v2/accounts/1/runs/?limit=10 to get the format of created_at, then add values in that format to a JSON array:

[
"2023-09-01 00:05:06.653504+00:00",
"2023-09-11 00:05:06.653504+00:00"
]

Noting that I did this in the Chrome browser and characters were urlencoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants