Team Server API - get revisions from branch

0
I am trying to retrieve revisions from branches in my projects, using the Mendix Team Server API. The default case of retrieving revisions from the trunk is working fine. Retrieving revisions from a branch line is not working, since the API is returning errors. (For sake of completeness: this branch used in the example does contain revisions the name of the branch in the example has been retrieved through the team server API) When I retrieve all branches for an App, I notice that the Name of a Branch is 'branches/BranchName', so e.g. branches/branch-Developer1. This results in the following API call to get the revisions: HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/' This request leads to the following error: com.mendix.modules.microflowengine.MicroflowException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "NOT_FOUND: GET 1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/ Unknown service at: '1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/'", "errorCode": "NOT_FOUND" }'] at module.Microflow1 (JavaAction : 'request') at module.Microflow2 (SubMicroflow : 'Microflow1') at module.Microflow3 (SubMicroflow : 'Microflow2') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:143) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "NOT_FOUND: GET 1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/ Unknown service at: '1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/'", "errorCode": "NOT_FOUND" }'] at com.mendix.core.component.InternalCore.execute(InternalCore.java:385) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "NOT_FOUND: GET 1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/ Unknown service at: '1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/'", "errorCode": "NOT_FOUND" }'] at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:178) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "NOT_FOUND: GET 1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/ Unknown service at: '1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/'", "errorCode": "NOT_FOUND" }'] at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) Caused by: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "NOT_FOUND: GET 1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/ Unknown service at: '1/apps/testihazmanybranch/branches/branches/branch-Developer1/revisions/'", "errorCode": "NOT_FOUND" }'] When I remove the branches/ part, so the request looks like: HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branch-Developer1/revisions/ I get another error: com.mendix.modules.microflowengine.MicroflowException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "There is no branch with name 'branch-Developer1'.", "errorCode": "BRANCH_NOT_FOUND" }'] at module.Microflow1 (JavaAction : 'request') at module.Microflow2 (SubMicroflow : 'Microflow1') at module.Microflow3 (SubMicroflow : 'Microflow2') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:143) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "There is no branch with name 'branch-Developer1'.", "errorCode": "BRANCH_NOT_FOUND" }'] at com.mendix.core.component.InternalCore.execute(InternalCore.java:385) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "There is no branch with name 'branch-Developer1'.", "errorCode": "BRANCH_NOT_FOUND" }'] at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:178) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "There is no branch with name 'branch-Developer1'.", "errorCode": "BRANCH_NOT_FOUND" }'] at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) Caused by: restservices.consume.RestConsumeException: 404. Rest request failed: [HTTP Request: GET 'https://deploy.mendix.com/api/1/apps/testihazmanybranch/branches/branch-Developer1/revisions/' --> Response status: 404 Not Found, ETag: null, body: '{ "errorMessage": "There is no branch with name 'branch-Developer1'.", "errorCode": "BRANCH_NOT_FOUND" }'] So, what is the correct way of retrieving revisions from a branch line?
asked
1 answers
1

It has to do with the slash behind branches / revisionName. Replacing this with: %2F, it will fix the url encoding. For the same reason spaces in revision names need to be encoded (%20).

Hope this will help :)

answered