Authenticating to the API

Help for Z-Command related issues only
photinus
Posts: 1
Joined: Mon Apr 13, 2015 6:06 pm

Authenticating to the API

Postby photinus » Mon Apr 13, 2015 6:09 pm

How can I go about authenticating for the API? I see the getToken call, but there is no documentation about what kind of information to pass into the call to authenticate.

Unrelated, Is there a way to trigger an update? I saw on the whats-new section that version 6151 was out, but I'm on 6149 and it's not prompting for an update.

admin
Site Admin
Posts: 50
Joined: Sun Dec 14, 2014 2:05 pm
Location: Washington
Contact:

Re: Authenticating to the API

Postby admin » Wed Apr 15, 2015 6:46 am

Sorry about the delayed response.

The information you need to pass along to the API is shown on the API documentation page:

Code: Select all

http://your_z-command_ip_address/apidoc/TokenAuth


You need to call POST /api/tokenauth with a JSON literal object containing two properties: username and password.

The API will return a response with a property called responseObject. The responseObject property contains your authentication token, which you can use to authorize subsequent API calls by passing the value in the header.

To authorize subsequent API calls, pass an autorization header value containing

Code: Select all

"Token " + token_value_here


with your call.

For the update, are you able to access the following URL form your network?

Code: Select all

http://update.z-command.com/latest.txt


Return to “Z-Command help”

Who is online

Users browsing this forum: No registered users and 1 guest

cron