Difference between revisions of "API Authentication"
IVSWikiBlue (talk | contribs) |
IVSWikiBlue (talk | contribs) |
||
| Line 20: | Line 20: | ||
|} | |} | ||
| − | |||
| + | ==Request Parameters== | ||
| + | ===JSON Body=== | ||
| + | The JSON body must be properly formatted. All fields and values should be enclosed in double quotes and separated by a colon | ||
{|class="wikitable" | {|class="wikitable" | ||
!Name | !Name | ||
| Line 39: | Line 41: | ||
|} | |} | ||
| − | |||
| + | ==Response== | ||
| + | ===HTTP Code=== | ||
{|class="wikitable" | {|class="wikitable" | ||
!Code | !Code | ||
| Line 52: | Line 55: | ||
|} | |} | ||
| + | ===JSON Body=== | ||
{|class="wikitable" | {|class="wikitable" | ||
| − | |||
!colspan="2"|data | !colspan="2"|data | ||
|- | |- | ||
| Line 59: | Line 62: | ||
|access token for use in any API calls that require authentication | |access token for use in any API calls that require authentication | ||
|} | |} | ||
| + | |||
==Examples== | ==Examples== | ||
Revision as of 09:47, 3 March 2026
Prior to issuing any API call, you will first need to authenticate with the VALT application. This should be completed by issuing the following API call. After authenticating successfully, you will receive an access token. Save this access token as it will be used in all other API calls.
Contents
Resource URL
http://valt.example.com/api/v3/login
Resource Information
| Method | POST |
| Headers | Content-Type:application/json |
| Response Type | JSON |
| Authentication Required | No |
Request Parameters
JSON Body
The JSON body must be properly formatted. All fields and values should be enclosed in double quotes and separated by a colon
| Name | Description | Required | Example |
|---|---|---|---|
| Username | Username for a VALT user, can be a local or LDAP user. | yes | admin |
| Password | VALT password for the specified user. | yes | admin |
Response
HTTP Code
| Code | Reason |
|---|---|
| 200 | Authentication Successful |
| 401 | Invalid Username or Password |
JSON Body
| data | |
|---|---|
| access_token | access token for use in any API calls that require authentication |
Examples
Request
The sample JSON body below is formatted with line breaks and indentation to make it easier to read. This is not required.
https://ivstest1.ad.ipivs.com/api/v3/login
{
"username":"admin",
"password":"admin"
}
Successful Response
{"data":{"access_token": "e82632d19c523678fea3d1016c6df9e9" }}
Failure Response
{"data": "Invalid username or password"}