Secure Code Warrior DirectLinking API API Reference

Secure Code Warrior's Direct link API is a service to allows our partners to link directly to our content in the SCW website trial. We support standard API responses (where JSON data is returned) and also a redirection capability, allowing partners to redirect their users to content directly.

The main service endpoint resides GET /api/v1/trial

A typical request looks like this:

https://integration-api.securecodewarrior.com/api/v1/trial?Id=scw&MappingList=cwe&MappingKey=89&LanguageKey=java

To get your referred identifier please send a request to integration-partners@securecodewarrior.com

Version: 1.1.0

DirectLinking

Get Trial Link

GET /api/v1/trial

This endpoint returns an object containing a URL that can be used to send a user to the Secure Code Warrior Website Trial.

Id

The referrer Identifier:

Please send a request to integration-partners@securecodewarrior.com to get your company specific id

type
string
in
query
MappingList

The vulnerability mapping list you want to use. If no mapping list is defined, the default mapping list based on the Secure Code Warrior vulnerability categories is used. For a complete list of all available mapping lists, use GET /api/v1/mapping-lists

type
string default
in
query
MappingKey

The specific vulnerability key. For a complete list of all available vulnerability keys, use GET /api/v1/mapping-lists/{slug}/items

type
string
in
query
LanguageKey

The specific language key. For a complete list of all available language keys, use GET /api/v1/language-keys

type
string
in
query
redirect

If true, the user will be redirected to the Secure Code Warrior trial page. If false or empty, a JSON response is presented with the trial url, a name and the description.

type
boolean
in
query
200 OK

Success

400 Bad Request

Bad Request

404 Not Found

Not Found

Response Content-Types: application/json
Response Example (200 OK)
{
  "url": "https://portal.securecodewarrior.com/?#/website-trial/web/injection/sql",
  "name": "SQL Injection",
  "description": "Some description",
  "videos": [
    "string"
  ]
}
Response Example (400 Bad Request)
"object"
Response Example (404 Not Found)
{
  "name": "ValidationError",
  "message": "Parameters validation error!",
  "code": 400
}

Get Trial Link (Deprecated)

GET /partner

DEPRECATED - This endpoint returns an object containing a URL that can be used to send a user to the Secure Code Warrior Website Trial.

Id

A valid Partner Identifier

type
string
in
query
MappingKey

A valid mapping key related to the Partner Identifier

type
string
in
query
redirect

If true, the user will be redirected to the Secure Code Warrior trial page. If false or empty, a JSON response is presented with the trial url, a name and the description.

type
boolean
in
query

Success

422 Unprocessable Entity

The key was not found or the Id is invalid If the key was not found you get an InvalidRequest object as result

Response Content-Types: application/json
Response Example (200 OK)
{
  "url": "https://portal.securecodewarrior.com/?#/website-trial/web/injection/sql",
  "name": "SQL Injection",
  "description": "Some description"
}
Response Example (422 Unprocessable Entity)
{
  "type": "VALIDATION_ERROR",
  "data": [
    {
      "type": "required",
      "field": "mappingKey",
      "message": "The mappingKey field is required"
    }
  ],
  "name": "ValidationError",
  "message": "Parameters validation error!",
  "code": 400
}

LanguageKey

Get Language Keys

GET /api/v1/language-keys

Get an overview of supported Language mappings

Success

Response Content-Types: text/plain, application/json, text/json
Response Example (200 OK)
[
  {
    "languageKey": "java",
    "languageFramework": "Java / Enterprise Edition (JSP)"
  }
]

MappingList

Get Mapping Lists

GET /api/v1/mapping-lists

Get an overview of supported mapping lists

Success

Response Content-Types: text/plain, application/json, text/json
Response Example (200 OK)
[
  {
    "slug": "slug",
    "name": "Name",
    "links": "object"
  }
]

Get Mapping List Items

GET /api/v1/mapping-lists/{slug}/items

Get the available mapping items for a specific mapping list

slug

(no description)

type
string
in
path
Page

Use this parameter to paginate the results (only positive numbers allowed)

type
integer (int32) , { x ∈ ℤ | 1 ≤ x ≤ 2147483647 }
in
query

Success

404 Not Found

Not Found

Response Content-Types: text/plain, application/json, text/json
Response Example (200 OK)
{
  "items": [
    {
      "mappingKey": "mapping_key",
      "name": "SQL Injection"
    }
  ],
  "metaData": {
    "pageCount": 3,
    "totalItemCount": 250,
    "pageNumber": 2,
    "pageSize": 100,
    "hasPreviousPage": true,
    "hasNextPage": true,
    "isFirstPage": false,
    "isLastPage": false,
    "firstItemOnPage": 101,
    "lastItemOnPage": 200
  }
}
Response Example (404 Not Found)
{
  "type": "string",
  "title": "string",
  "status": "integer (int32)",
  "detail": "string",
  "instance": "string"
}

Schema Definitions

MappingResult: object

url: string

The url that can be used to redirect a user to the Secure Code Warrior website trial

name: string

The name of the category used in the mappingKey query parameter

description: string

A description on the category used in the mappingKey query parameter

videos: string[]

A list of videos

Example
{
  "url": "https://portal.securecodewarrior.com/?#/website-trial/web/injection/sql",
  "name": "SQL Injection",
  "description": "Some description",
  "videos": [
    "string"
  ]
}

InvalidRequest: object

name: string
message: string
code: integer (int32)
Example
{
  "name": "ValidationError",
  "message": "Parameters validation error!",
  "code": 400
}

LegacyMappingResult: object

url: string

The url that can be used to redirect a user to the Secure Code Warrior website trial

name: string

The name of the category used in the mappingKey query parameter

description: string

A description on the category used in the mappingKey query parameter

Example
{
  "url": "https://portal.securecodewarrior.com/?#/website-trial/web/injection/sql",
  "name": "SQL Injection",
  "description": "Some description"
}

ValidationError: object

type: string
field: string
message: string
Example
{
  "type": "required",
  "field": "mappingKey",
  "message": "The mappingKey field is required"
}

LegacyInvalidRequest: object

type: string
data: object[]
name: string
message: string
code: integer (int32)
Example
{
  "type": "VALIDATION_ERROR",
  "data": [
    {
      "type": "required",
      "field": "mappingKey",
      "message": "The mappingKey field is required"
    }
  ],
  "name": "ValidationError",
  "message": "Parameters validation error!",
  "code": 400
}

LanguageKeyResponse: object

languageKey: string

The language key that can be used in the trial endpoint

languageFramework: string

The Secure Code Warrior Language and Framework that the key will map to

Example
{
  "languageKey": "java",
  "languageFramework": "Java / Enterprise Edition (JSP)"
}

MappingListResponse: object

slug: string

A mapping list slug

name: string

The mapping list name

links: object
Example
{
  "slug": "slug",
  "name": "Name",
  "links": "object"
}

ProblemDetails: object

type: string
title: string
status: integer (int32)
detail: string
instance: string
object
Example
{
  "type": "string",
  "title": "string",
  "status": "integer (int32)",
  "detail": "string",
  "instance": "string"
}

MappingItemResponse: object

mappingKey: string

The mapping key that can be used in the trial endpoint

name: string

The name of the mapping key

Example
{
  "mappingKey": "mapping_key",
  "name": "SQL Injection"
}

PaginationMetaData: object

pageCount: integer (int32)
totalItemCount: integer (int32)
pageNumber: integer (int32)
pageSize: integer (int32)
hasPreviousPage: boolean
hasNextPage: boolean
isFirstPage: boolean
isLastPage: boolean
firstItemOnPage: integer (int32)
lastItemOnPage: integer (int32)
Example
{
  "pageCount": 3,
  "totalItemCount": 250,
  "pageNumber": 2,
  "pageSize": 100,
  "hasPreviousPage": true,
  "hasNextPage": true,
  "isFirstPage": false,
  "isLastPage": false,
  "firstItemOnPage": 101,
  "lastItemOnPage": 200
}

PagedMappingItemResponse: object

items: object[]
metaData: PaginationMetaData
Example
{
  "items": [
    {
      "mappingKey": "mapping_key",
      "name": "SQL Injection"
    }
  ],
  "metaData": {
    "pageCount": 3,
    "totalItemCount": 250,
    "pageNumber": 2,
    "pageSize": 100,
    "hasPreviousPage": true,
    "hasNextPage": true,
    "isFirstPage": false,
    "isLastPage": false,
    "firstItemOnPage": 101,
    "lastItemOnPage": 200
  }
}