Printer FriendlyEmail Article Link

Spirent Velocity: How to send Rest API call using token?

Objective/Summary
Velocity API is an interface for external applications to operate services that are part of Velocity. The API is RESTful and consists of a set of resources (REST) that can be retrieved (GET), created (POST), deleted (DELETE), or updated (PUT).
 
The API documentation is available on your Velocity instance (when logged into your instance) and on Spirent Knowledge Base: https://support.spirent.com/SpirentCSC/SC_KnowledgeView?id=DOC10663
 
Environment/Versions
Spirent Velocity & VDS 
 
Procedure
If not specified explicitly, each request requires authentication.
API client can use one of the following authentication methods:
  • Basic HTTP access authentication.
  • Token request header authentication - the token is provided as an “X-Auth-Token” request header value.
  • Token query parameter authentication - the token is provided as the “token” query parameter value.
 
NOTE: Repository, Execution, Reporting services support only “X-Auth-Token” request header authentication. The token can be obtained by calling GET /token on Auth Service.
 
Example of using API from iTest
  • In iTest Enterprise, create a REST session and edit the REST session profile.
  • For the Authentication property, select Basic.
  • Enter the User name and Password.
  • Check ‘Trust any SSL certificate from the server’

 
  • Send GET /token api call to get the necessary token

 
  • Use the token to retrieve the list of testcases in Velocity:
GET /ito/repository/v1/testcases (with X-Auth-Token as parameter).
  • If token is missing this error is returned:
{"status":401,"message":"Token is missing","moreInfo":null,"errorId":"BAD_AUTH"}
 

Product : Velocity Core,Velocity Portfolio