Project

General

Profile

how to provide api access KEY when using POST in REST API

Added by Alex Last over 13 years ago

I need to provide api access key when creating issue via HTTP POST request in REST API.
how do I provide it? in the URL?
in HTTP request headers? in the request body together with the issue xml text? somehow else?

I can create issue with basic HTTP authorization (username & password), but need to use api access key.


Replies (2)

RE: how to provide api access KEY when using POST in REST API - Added by Chrisitian Noack over 13 years ago

It work, if you have it in the URL, like this:

echo '<issue></issue>' | curl -X PUT -H 'Content-type: text/xml' -H 'Accept: text/xml' -d @- http://localhost:3000/issues/11?format=xml\&key=123456aef3948ef2939

This is just a simple example using curl for a PUT request with almost no payload. This request would UPDATE the issue. Should work with POST also.

    (1-2/2)