Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
shun888
Frequent Visitor

Syntax help for ADO API request

Hi, 

 

I am trying to use the following GET command with a creation date range parameter but I am not too sure what the syntax is.

 

The naked GET request is:

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?ap...

 

The parameter that I am trying to use is:

searchCriteria.queryTimeRangeType

 

I tried the following syntax and it didnt work.

 

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?searchCriteria.queryTimeRangeType=1/08/2024&1/10/2024?api-version=7.1-preview.1

 


Here is a link to the API documentation - https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/get-pull-requests?view=azu...

 

This was what is listed as the description to that parameter:

searchCriteria.queryTimeRangeType
query 

PullRequestTimeRangeType

The type of time range which should be used for minTime and maxTime. Defaults to Created if unset.

 

Anyone know what the syntax should be here?

 

Any help is appreciated thanks!

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @shun888 ,

Please update the codes as below and check if it can return the expected result...

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?minTime=2024-08-01T00:00:00Z&maxTime=2024-10-01T00:00:00Z&api-version=7.1-preview.1

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @shun888 ,

Please update the codes as below and check if it can return the expected result...

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?minTime=2024-08-01T00:00:00Z&maxTime=2024-10-01T00:00:00Z&api-version=7.1-preview.1

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That worked thanks for the help!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Kudoed Authors