> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/s/secure-code-warrior.md).

# Secure Code Warrior

Secure Code Warrior is a secure coding training platform. OctoXLabs uses it to add its users to the user inventory.

## Use cases

* List Secure Code Warrior users.

```
Adapters = secure-code-warrior
```

## Before you begin

### Network

| Source              | Destination                                                                       | Port | Protocol |
| ------------------- | --------------------------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | portal-api.securecodewarrior.com (US) or portal-api.eu.securecodewarrior.com (EU) | 443  | HTTPS    |

### Required permissions

| Scope or role                 | Permission | Needed for              |
| ----------------------------- | ---------- | ----------------------- |
| Company Admin (Admin API key) | Read       | Users (`/api/v2/users`) |

You must be a Company Admin to generate an Admin API key.

## Create credentials in Secure Code Warrior

{% stepper %}
{% step %}

### Open Edit Company

Go to **Administration > Platform configuration > Edit Company**.
{% endstep %}

{% step %}

### Find the Admin API section

API access is disabled by default. If the **Admin API** section is not visible, contact your Customer Success Manager or submit a support request.
{% endstep %}

{% step %}

### Generate the key

Generate the Admin API key and copy it.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter   | Required | Type   | Default                          | Description                                                          |
| ----------- | -------- | ------ | -------------------------------- | -------------------------------------------------------------------- |
| Domain      | Yes      | String | portal-api.securecodewarrior.com | API host. Use portal-api.eu.securecodewarrior.com for the EU region. |
| API Token   | Yes      | String | None                             | Admin API key.                                                       |
| HTTPS Proxy | No       | String | None                             | Proxy URL for HTTPS requests.                                        |

## Troubleshooting

| Error message                          | Cause                                                                                                                                      | Fix                                                                                                                          |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| Failed to fetch users:                 | The users call returned a status other than 200.                                                                                           | Check the key and the region.                                                                                                |
| Request failed after 5 retries for url | The API kept returning HTTP 422.                                                                                                           | Retry later and check the account.                                                                                           |
| Status Code:                           | The API answered with a status other than the one the connector expects. The message also lists the URL, the method and the response body. | Read the status code and the response body in the message, then check the credentials, the permissions and the network path. |

## Change history

{% hint style="info" %}
Available starting from version 6.1.0.
{% endhint %}
