Enterprise REST API Overview
All API calls require an API Token to be submitted. Depending on the type of API call you are making the authentication token will change.
For example if you are automating the deployment of a scan engine to scan a web application in an on demand scenario for highly changing environments. You will need the following API tokens.
- System Administrator - All scan engine actions require a system administrator token.
- Client Account - All scan configurations and the launching of the scan will require a client account's Token to be used.
Base URLs
http://{servername}/AppSpiderEnterprise/rest/v1/
https://{servername}/AppSpiderEnterprise/rest/v1/
Authentication
Before using the AppSpider Enterprise API, you need to first add your token to the Authorization header.
- Make a POST request to the login endpoint
http://{servername}/AppSpiderEnterprise/rest/v1/Authentication/Login
to get your token. - Use the response
Token
in request headers as basic authorization token.- For example,
Authorization: Basic ABC0123
- For example,
AppSpider Authentication
post
/AppSpiderEnterprise/rest/v1/Authentication/Login
Description Returns AppSpider authorization tokens.
Request Body
json
1{2"name": "string",3"password": "string"4}
Example Request
bash
1curl --request POST \2--url http:///%7Bservername%7D/AppSpiderEnterprise/rest/v1/Authentication/Login \3--header 'content-type: application/json' \4--data '{"name":"string","password":"string"}'
ruby
1require 'uri'2require 'net/http'34url = URI("http:///%7Bservername%7D/AppSpiderEnterprise/rest/v1/Authentication/Login")56http = Net::HTTP.new(url.host, url.port)78request = Net::HTTP::Post.new(url)9request["content-type"] = 'application/json'10request.body = "{\"name\":\"string\",\"password\":\"string\"}"1112response = http.request(request)13puts response.read_body
python
1import http.client23conn = http.client.HTTPConnection("insertConsole")45payload = "{\n \"name\": \"insertUsername\",\n \"password\": \"insertPassword\"\n}"67headers = {8'content-type': "application/json",9'cache-control': "no-cache"10}1112conn.request("POST", "/AppSpiderEnterprise/rest/v1/Authentication/Login", payload, headers)1314res = conn.getresponse()15data = res.read()1617print(data.decode("utf-8"))
Response
200 - OK
json
1{2"Token": "",3"IsSuccess": true,4"Reason": null,5"ErrorMessage": null6}
400 - Bad Request
json
1{2"Token": null,3"IsSuccess": false,4"Reason": "InvalidCredentials",5"ErrorMessage": "Invalid username or password."6}
Name | Definition |
---|---|
IsSuccess | Contains a boolean value and has true if method executed correctly. |
Reason | Text of error that occured. |
ErrorMessage | Additional information about the error. |
Did this page help you?