- Checkmarx Documentation
- Checkmarx Codebashing
- Working with the Checkmarx Codebashing API
Working with the Checkmarx Codebashing API
The Checkmarx Codebashing API reference is available to administrators in the Codebashing platform via the user interface. To explore the Codebashing API through Swagger, you have to log in. To log in, click <Authorize>.
To log in, you have to first create API credentials for the user. By doing so, you enable API access to anybody in your organization who knows the respective API credentials.
From the menu, select API Credentials. The API Credentials dashboard appears together with the Swagger API reference list.
Note
If you don't have any API credentials yet, you have to create them as explained in the next section.
To log in to access the Swagger API reference, click <Authorize>. You are asked to provide your token and the associated key.
Enter the token under basic_auth and click <Authorize> in that line.
Enter the key under api_key respectively and click <Authorize> again in this line. You are now logged in and ready to fully explore the API.
Note
Once you finished with the API, log out by clicking <Logout> for basic_auth and api_key.
Click <New API Credentials> at the top. You are asked to enter a name that defines the new API credential.
Enter a name, for example JJJ_Tester and then click <Create API Credentials>. The API credential is created.
To view the new credential, navigate to the last page of the API credential list. The newest credential is listed at the bottom of the list.
Note
The instructions below use the Quiz Info API as an example of how to visualize and interact with your API resources in Swagger without affecting the code.
Click in the line of the Quiz Info API. The list entry is expanded as illustrated in the second screen image below.
Click <Try it out>. You are asked to enter your tenant.
Enter your tenant name and click <Execute>. The full API response is displayed and a download link for this API response becomes available. The screen image below illustrates the request URL and the response body with the download link.
To download the API response, click in the lower right corner of the response body display. The API response is downloaded as a *.JSON file.
Note
The instructions below use the Quiz Info API as an example of how to call an API using Postman. You may write your own code that calls the API using the headers as illustrated in this example.
Open the application you are using to send the desired specific API to your Codebashing server, in this case Quiz Info API.
Enter the Platform URL (the URL of the Codebashing server) and the API you wish to send as illustrated below.
Enter the Authorization header and the X-API-KEY header as illustrated below. {{token}} and {{key}} stand for the token and the key of the API credentials you created.
Send the API request
Navigate to the relevant list entry and click <Delete>.
Confirm your request. The credential is deleted from the list.