PerkinElmer Informatics Support Forum
Decrease font size
Increase font size
Topic Title: Testing the REST API token authentication via command line
Topic Summary:
Created On: 11/29/2016 6:37 AM
Status Post and Reply
Linear : Threading : Single : Branch
Topic Tools Topic Tools
View topic in raw text format. Print this topic.
 11/29/2016 6:37 AM
User is offline View Users Profile Print this message


Posts: 57
Joined: 5/13/2014

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.

**INSERT the unique username and password where specified.

[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:

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, or contact the Informatics Support team using for further assistance.

Edited: 1/11/2017 at 7:18 AM by NW

FuseTalk Basic Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.