Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get next page of pipeline config variables ?

Appan Ponnappan August 12, 2019

The document asks to use the next page URL in the "next" property but it has the older v1.0 URL like the following which does not work:

https://bitbucket-pipelines.prod.public.atl-paas.net/rest/1.0/accounts/<uuid>/repositories/<uuid>/variables?page=2&pagelen=10

I used the v2.0 URL to get the 1st page and I  tried appending the URL page & pagelen parameters (as given below) to it which does not work, I get "resource not found" error.

What is the correct end-point URL to use to get the next page of variables?

https://api.bitbucket.org/2.0/repositories/<account>/<repo slug>/pipelines_config/variables?page=2&pagelen=10

 

1 answer

0 votes
Peter Plewa
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 2, 2019

Hi @Appan Ponnappan

Your url is correct

https://api.bitbucket.org/2.0/repositories/<account>/<repo slug>/pipelines_config/variables?page=2&pagelen=10

The reason you're getting 404 error is that you're not authenticated, have a look how to authenticate requests at:

https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication

Thanks,
Peter

Appan Ponnappan September 3, 2019

I am not sure why should I get a 404 error when authentication fails or when the access token has expired. It should be only 401 error which I am not getting.

I am using grant_type as client_credentials and I am able to get the 1st page of variables without any error, so I don't think there is any scope issue.

First of all, why should the "next" field in the response having the older v1.0 end-point URL, when the request has v2.0 end-point URL?

Secondly, the API pagination docs says the following. So, ideally, I should be able to get the next page by just using the URL in the next field.

The link to the next page is included such that you don't have to hardcode or construct any links. Only values and next are guaranteed (except the last page, which lacks next). This is because the previous and size values can be expensive for some data sets.

Peter Plewa
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2019

Hi @Appan Ponnappan

You are correct, the link in **next** section is incorrect and points to the wrong resource. I will mark it as a bug and get the team to triage, thanks for bringing it to our attention. In the meantime you should be able to construct next page url that is similar to the one you are using to fetch the first page of variables.

Thanks,
Peter

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events