I have the following question: I am trying to download the latest artifacts using API method
curl -X GET https://circleci.com/api/v1.1/project/github/< username >/< project >/latest/artifacts?circle-token=< token >&branch=master&filter=completed
But the response is empty [ ], and I see that it was split into two different responses.
I’ve started the command but response was getting when the command finished.
autotest-MacBook-Pro: autotest$ curl -X GET https://circleci.com/api/v1.1/project/github/< username >/< project >/latest/artifacts?circle-token=< token >&branch=master&filter=completed
[1] 23873
[2] 23874
[2]+ Done branch=master
autotest-MacBook-Pro: autotest$ [ { correct response here } ]
I used the CircleCI API earlier and hadn’t faced with this issue.
Probably something was changed in API and I should add something here to get the result in the first response?
Silly question then, are you sure the master branch’s latest job has artifacts? If you are using a workflow it may be that one of the jobs in the workflow has the artifacts, but not the latest one.
I see the not empty response in the second part of the output but when I run it in terminal I see that the curl command finished with output
[1] 23873
[2] 23874
[2]+ Done branch=master
and over time I get the valid response in the terminal
It seems as the request was performed in another thread or it was redirected
I see the same issue with Postman and HttpClient java. It returns the code=200 and response=[ ]