Difference between revisions of "API Authentication"

From IVS Wiki
Jump to: navigation, search
(Examples)
 
(7 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
|'''Method'''
 
|'''Method'''
 
|POST
 
|POST
|-
 
|'''Headers'''
 
|Content-Type:application/json
 
 
|-
 
|-
 
|'''Response Type'''
 
|'''Response Type'''
Line 19: Line 16:
 
|}
 
|}
  
===Parameters===
 
  
 +
==Request Parameters==
 +
===Path Parameters===
 +
No path parameters are required for this request.
 +
 +
===Query Parameters===
 +
No query parameters are required for this request.
 +
 +
===Headers===
 +
{|class="wikitable"
 +
!Name
 +
!Value
 +
|-
 +
|Content-Type
 +
|application/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 30: Line 44:
 
|Username for a VALT user, can be a local or LDAP user.
 
|Username for a VALT user, can be a local or LDAP user.
 
|yes
 
|yes
|admin
+
|John Smith
 
|-
 
|-
 
|Password
 
|Password
 
|VALT password for the specified user.
 
|VALT password for the specified user.
 
|yes
 
|yes
|admin
+
|MyPassword12345
 
|}
 
|}
  
===Response===
 
  
 +
==Response==
 +
===HTTP Code===
 
{|class="wikitable"
 
{|class="wikitable"
 
!Code
 
!Code
Line 51: Line 66:
 
|}
 
|}
  
 +
===JSON Body===
 
{|class="wikitable"
 
{|class="wikitable"
|+JSON Response
 
 
!colspan="2"|data
 
!colspan="2"|data
 
|-
 
|-
Line 58: Line 73:
 
|access token for use in any API calls that require authentication
 
|access token for use in any API calls that require authentication
 
|}
 
|}
 +
  
 
==Examples==
 
==Examples==
Line 65: Line 81:
 
  <nowiki>
 
  <nowiki>
 
{
 
{
   "username":"admin",
+
   "username":"John Smith",
   "password":"admin"
+
   "password":"MyPassword12345"
 
}
 
}
 
</nowiki>
 
</nowiki>

Latest revision as of 10:19, 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.

Resource URL

http://valt.example.com/api/v3/login

Resource Information

Method POST
Response Type JSON
Authentication Required No


Request Parameters

Path Parameters

No path parameters are required for this request.

Query Parameters

No query parameters are required for this request.

Headers

Name Value
Content-Type application/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 John Smith
Password VALT password for the specified user. yes MyPassword12345


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":"John Smith",
  "password":"MyPassword12345"
}

Successful Response

{"data":{"access_token": "e82632d19c523678fea3d1016c6df9e9" }}

Failure Response

{"data": "Invalid username or password"}