Mendix Deploy API - Retrieve Branch Information

Hi all, I am build a Jenkins pipeline for my Mendix application. As part of this pipeline I want to check what is the latest available revision for my app. This information is available by querying the following url<my-app-name>/branches/trunk The response is: { "LatestTaggedVersion": "XXXXX", "DisplayName": "Main line", "LatestRevisionMendixVersion": "XXXX", "LatestRevisionNumber": 9999, "Name": "trunk" } That is exactly what I need. However, because of reasons, we are not using the main line i.e. trunk. Instead we are using another branch called “development” (dont ask why) When I try to query<my-app-name>/branches/development the server responds with a 404, not found?? I am a lost. I checked the spelling ten times it is correct. Has anyone else experienced this issue? Any idea what I am doing wrong? -Andrej
2 answers

I think your URL is wrong. Try first{1}/branches/ where {1} is your app ID.

That will give you your branches. Then you can do{1}/branches/{2}/revisions/ where {1} is again your app ID and {2} is the branchname that you retrieved from the first call. Do not forget to URL encode that name.



[EDIT] and if you are interested I can give you my module for automatic deployment. It is in Mx6.9.1. Still plan to create an appstore module for it. Only have to find the time to finsih it.



Thanks Ronald for the great answer:

After I queried my branches at<my-app-name>/branches/
It turned out the full name of the branch I was trying to query is “branches\development” instead of simply “development” as one would expect. My best guess is that Mendix adds the prefix “branches\” for some reason. This was the case for all branches except the “trunk”
Anyways after I had the correct branch name I still had to URL encode it as Ronald said. In the end the following URL worked for me<my-app-name>/branches/branches%2Fdevelopment

Notice that the seconds slash is encoded as %2F

Cheers Ronald