Quantcast
Channel: PerkinElmer Informatics Support Forum
Viewing all articles
Browse latest Browse all 469

Testing the REST API token authentication via command line

$
0
0

If you have command line access to the Linux back-end then the token authentication can quickly be tested for any Columbus user account using the curl tool.

[columbus@columbus]$ curl -i -X POST -H 'Content-Type: application/json' -d '{"userName": "INSERT", "password": "INSERT", "urls": ["/api/1.1/images/*"]}' http://columbus/api/1.1/authentication/token

Which should yield an output like this:

HTTP/1.1 201 CREATED
Server: nginx/1.0.8
Date: Tue, 02 Aug 2016 13:36:32 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Language
Content-Language: en-us

{"token": "a436ac1b-5965-4ad9-abf9-487f1b6031e0", "urls": ["/api/1.1/images/*"]}

The authentication token can be used to test image retrieval. The example below requests image with ID 2801 and saves it to the local /tmp directory on the Columbus server.

Note: The measurement containing image with ID 2801 must first be published via the Columbus web interface in order for the images to be accessible to the API.

[columbus@columbus]$ curl -H 'PKI-Columbus-Authentication: a436ac1b-5965-4ad9-abf9-487f1b6031e0' http://columbus/api/1.1/images/2801.tiff -o /tmp/2801.tiff

If the authentication fails, check the /var/log/columbus/web/columbus.log for details. Please contact the Informatics Support team if further assistance is required.


Viewing all articles
Browse latest Browse all 469

Trending Articles