コンテンツにスキップ

Generating API Tokens

To execute Mayhem runs and download test cases or coverage files via the CLI, it is necessary to generate and authenticate Mayhem API tokens with the Mayhem server. Developers can use the mapi login command along with their API token to authenticate with their Mayhem instance.

Tip

See Installing the API testing CLI for more information.

From the Mayhem UI Home screen, click on your profile in the bottom-left of the main navigation pane and select Account Settings. Then, click on API Tokens and select Create Token.

mayhem-ui-homepage

Managing Your API Tokens

Within the API Tokens page, you can view a list of your active API tokens for your user account and when they were last accessed or used.

Here you can perform the following actions:

  1. Issue a New API Token: Creates an entirely new API token for the current user.
  2. Revoke an Existing API Token: Deletes the specified API token from the current user.

Note

To adhere to security best practices, the actual API token will only be visible upon its initial creation. In the event that you forget your API token, the recommended approach is to generate a new one. This ensures the ongoing security of your system and protects against unauthorized access.

Summary

To perform API testing runs and download test cases or coverage files, it is essential to log in to your Mayhem server deployment using the mapi login command and one of your API tokens.

Having knowledge of the location to navigate to for viewing and managing your API tokens will assist you in setting up your environment effectively, enabling seamless utilization of the API testing CLI.