Hello Mirko,

Yes, the APIs are versioned using that header. Unlike other API systems
where the whole set of APIs are versioned as a whole, in this case, each
endpoint is versioned separately. It has its pros and cons. On one hand, if
nothing has changed in one API, then for a client (user), nothing needs to
change. However, if another API keeps changing, then the version will need
to be updated.

The versions are all mentioned in their documentation, against the version
of the GoCD server. Any deprecations are also mentioned ahead of time in
the release notes.

- Aravind

On Fri, Jul 7, 2017 at 8:08 AM, Mirko Friedenhagen <[email protected]>
wrote:

> Hello there,
>
> I would like to automate pipeline/template creation, so I took a look
> at the nice documentation at
> https://api.gocd.org/current/#template-config. Version of gocd is
> 17.1.0
>
> Now after playing around a bit with curl I am confused:
> * it seems I always need to specify the *exact* version I want to retrieve
>
> Working examples which return JSON
> curl -b cookie.jar -H 'Accept: application/vnd.go.cd.v3+json'
> https://gocdserver.lan/go/api/admin/templates
>
> curl -b cookie.jar -H 'Accept: application/vnd.go.cd.v4+json'
> https://gocd.server.lan/go/api/agents
>
> curl -b cookie.jar -H 'Accept: application/json'
> https://gocd.server.lan/go/api/config/materials
>
> Now i I try something like
> curl -b cookie.jar -H 'Accept: application/vnd.go.cd.v4+json'
> https://gocd.server.lan/go/api/config/materials
>
> or
>
> curl -b cookie.jar -H 'Accept: application/json'
> https://gocdserver.lan/go/api/admin/templates
>
> does not work
>
> Is this expected? I tried application/* and */* as well, for materials
> this is working, the other objects always return a HTML error-page.
>
> Is this the intended behavior or do I do something wrong?
>
> Best Regards Mirko
> --
> http://illegalstateexception.blogspot.com/
> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
> https://bitbucket.org/mfriedenhagen/
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to