Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Enabling BuildMaster JSON API?
-
Just starting to dive into the API functionality in BuildMaster.
Am I right in understanding that there's a generic API (like the one here) and a Native API (like the one here)?
- I tried calling http://<buildmaster>/api/ - which didn't give me anything (just a 404)
- I tried calling http://<buildmaster>/api/soap - which gave the the SOAP methods (YAY!)
- But then I tried calling http://<buildmaster>/api/json - which gave me no response at all
Ideally I'd like to be using the generic api (e.g. /api/releases/packages/deploy), which seems to not be found, but failing that the Native JSON api would be good.
Are there any examples of this (request-response sort of examples)? Do I need to enable the JSON API?
Any advice would be appreciated =)
Product: BuildMaster
Version: 5.3.7
-
You're right in that it's best to choose the specific API for your need (e.g. /api/releases/packages/deploy). The Native JSON API (/api/json) should show a list of methods that are supported when browsed directly... it should not result in a 404 (if that's what you're seeing, there must be a bug somewhere).
Those endpoints require an API key, you can set one up at
Admin > Security & Authentication > API Keys & Access Logs
. There will also be logs there for all API accesses.From there, you can supply the key in the URL query string as
key
(or any other supported method).Here is an example to list all deployments to the Testing stage for a certain application:
http://buildmaster/api/releases/packages/deployments?key=YourApiKey&applicationName=TDWTF2&pipelineStageName=Testing&indent=true
-
Thanks Todd.
I did some more trialing, but to no avail:
Thehttp://buildmaster/api/releases/packages/deployments?key=YourApiKey&applicationName=TDWTF2&pipelineStageName=Testing&indent=true URL (modified for us, of course)
is still returning 404s.Could it be the version of BuildMaster we're running? (Currently 5.3.7).
Further investigation finds:
- http://buildmaster/api/json?key=APIKEY returns a blank 200 page
- http://buildmaster/api/?key=APIKEY returns a 404 Not Found page
- http://buildmaster/api/json/Builds_PromoteBuild?key=APIKEY returns nothing (closed socket, i think)
When I look through the access-logs for the api I only have entries for the /api/json request (1) (not the /api (2) or /json/Build_PromoteBuild (3) requests).
Any ideas?
-
The Release & Deployment API was added in BuildMaster v5.5 so you'd have to upgrade to use it.
As for the /api/json page, it shouldn't require a key to view the methods so there's a bug there and I've added that to our internal issue tracker.