Good Morning prefect. Is it possible to get the la...
# ask-community
a
Good Morning prefect. Is it possible to get the latest deployment_id from the API? We are kicking off a flow run externally and are trying to just use the API and not the client. Trying to sift through the API docs and I don't see a way. Appreciate the help!
a
In the read deployment endpoint, isn't the deployment id required as a path parameter? I need to retrieve this deployment id
Thank you for the responses! I will look through the source code
a
I was looking at that one. Is the
id
in the response the deployment_id i am looking for?
r
yeah
a
Hell yeah!
hey @redsquare, really appreciate the help here. Thank you!
r
no worries
a
When using that endpoint, is this the json they are expecting?
Copy code
json={"flows": {"name": {"any_": ["FLOW_NAME"]}}}
r
looks right to me
a
Cool thanks for the extra look. It's not pulling the correct one, its returning an empty response so i might be doing something wrong. I'll play around with it. Appreciate the help
r
sure you have the corrcet name for the flow
with the slash
a
Yup. Printed off each and every deployment that was initially returned
Nope. hahah without the slash. I will try that.
r
if you do
prefect deployments ls
in the cli you can see the names it expects
a
I get an authorized error when trying that
r
have you
prefect cloud login
a
Yes. I was originally getting a 401 with an access key for the API and then had to create a service account one. But still getting that error here
r
have you set PREFECT_API_KEY - apologies if I am asking stupid questions 🙂
a
Yes
and no worries at all. I appreciate the help
r
what does
prefect profile use default
do
a
Ahhhh!
Error authenticating with Prefect Cloud using profile 'default'
r
yeah so the url or key is wrong
a
The url is randomly starting on a new line after the last
-
in the CLI, otherwise they are the same
r
odd - maybe try
prefect cloud logout
and try again
a
No luck with that
r
sure you have the correct service account key for the workspace
maybe rotate the api key and try again
a
Yeah i will try again
Created a service account admin key with the workspace role of owner and still getting the error
r
yeah not sure sorry - one for @Chris Reuter / prefect team I think
👀 1
a
Absolutely no worries @redsquare. Thank you for the help here
👍 1
Apologies! I figured it out. I had a version 1 prefect API key out there in my bash profile
😁 1
🙌 1
Removed that and now green lights all around
🔥 1
It isn't Monday anymore hahah is it?
🫣 1