Class ApiFunctionalities

java.lang.Object
javax.sound.sampled.spi.AudioFileWriter
com.cyara.apisamples.ApiFunctionalities

public class ApiFunctionalities
extends javax.sound.sampled.spi.AudioFileWriter
The heart and workhorse of all the API samples, used in every sample. Contains all of the HTTPS requests, the API calls using those requests, the retrieves the credentials to make those API calls. Also contains some basic, reused functions throughout this sample suite. If there's anything you should take and use in your own builds, it's this.

This is not an official Cyara product and is not officially supported. It is used for demonstration and training purposes. For assistance, contact chris.ryan@cyara.com

Version:
1.6
Author:
Chris Ryan
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int accountNum  
    private java.lang.String baseUrl  
    private java.lang.String keyToken  
  • Constructor Summary

    Constructors 
    Constructor Description
    ApiFunctionalities()
    The constructor to create the object.
  • Method Summary

    Modifier and Type Method Description
    (package private) javax.json.JsonObject convertAPIOutputToJson​(java.lang.String jsonStr)
    Convert a String object with Json format into a JsonObject
    (package private) org.w3c.dom.Document convertStringToDocument​(java.lang.String xmlStr)
    Convert a String object with XML format into an XMLDocument
    (package private) javax.json.JsonObject createCampaign​(java.lang.String campaignJson)
    Creates a campaign using the 3.0 API
    (package private) javax.json.JsonObject createDataset​(java.lang.String csvLocation)
    Takes in a valid .csv file and imports it into the portal, creating a brand new dataset
    (package private) int datasetPutPostDel​(java.lang.String httpMethod, java.lang.String apiCall, java.lang.String body, java.lang.String contentType)
    Make an HTTPS PUT/POST/DELETE call using Authorization and Json.
    (package private) javax.json.JsonObject deleteDataset​(int datasetId)
    Permanently and irreversibly deletes the single, specified dataset
    (package private) javax.json.JsonObject deleteDatasets​(java.lang.String datasetIds)
    Permanently and irreversibly deletes all the specified datasets
    (package private) javax.json.JsonObject executeCampaign​(int campaignId)
    Immediately starts the specified campaign
    (package private) javax.json.JsonObject executeTestCase​(int testCaseId)
    Runs the test case as a single validation run
    (package private) java.lang.String exportBlock​(int blockId)
    Exports a single block as Cyara XML
    (package private) java.lang.String exportBlocks​(java.util.ArrayList<java.lang.Integer> blockIds)
    Exports one or more blocks as Cyara XML
    (package private) javax.json.JsonObject exportCXModel​(int cxModelId)
    Makes an API call to export the specified CX Model into CX Model Json
    (package private) java.lang.String exportTestCase​(int testCaseId, java.lang.String blockOption)
    Exports a single test case as Cyara XML
    (package private) java.lang.String exportTestCases​(java.util.ArrayList<java.lang.Integer> testCaseIds, java.lang.String blockOption)
    Exports one or more test cases as Cyara XML
    (package private) javax.json.JsonObject filePutPost​(java.lang.String httpMethod, java.lang.String apiCall, java.lang.String fileLocation, java.lang.String fileType)
    Makes an HTTP PUT or POST with a file attached as part of the call
    (package private) javax.json.JsonObject generateStepTranscription​(int testResultId, int step)
    Makes an API call to generate the step transcription for any step in a voice call.
    (package private) javax.json.JsonObject getAccount()
    Makes an API call to return the account settings for the supplied account.
    int getAccountNum()
    Gets the account number the boilerplate is using in all the API calls.
    javax.sound.sampled.AudioFileFormat.Type[] getAudioFileTypes()  
    javax.sound.sampled.AudioFileFormat.Type[] getAudioFileTypes​(javax.sound.sampled.AudioInputStream stream)  
    java.lang.String getBaseUrl()
    Gets the Portal base Url the boilerplate is using.
    (package private) javax.json.JsonObject getCampaignRunByCampaignRunId​(int campaignId, java.lang.String campaignRunId)
    Gets the status of a campaign run
    (package private) javax.json.JsonObject getCampaignRunHistory​(int campaignId)
    Gets the run history of a campaign
    (package private) javax.json.JsonObject getCampaignRunTestStepResults​(int campaignId, int runId)
    Gets the results of a campaign run
    (package private) javax.json.JsonObject getDashboardFeed​(int dashboardId, int hours)
    Retrieves all the results and data used to create a Cyara Executive Dashboard up to the specified number of hours ago for the desired dashboard
    (package private) javax.json.JsonObject getDashboardTickers​(int dashboardId)
    Makes an API call to retrieve up to 1000 tickers that currently exist and are displayed for a given dashboard
    (package private) javax.json.JsonObject getDataset​(int datasetId)
    Makes an API call to return a specified dataset, including the headers and number of scenarios
    (package private) javax.json.JsonObject getDatasetRows​(int datasetId)
    Makes an API call to return up to 1000 scenarios (rows) for a specified dataset,
    (package private) javax.json.JsonObject getDatasetTestCases​(int datasetId)
    Makes an API call to return up to 1000 test cases currently using the specified dataset
    (package private) javax.json.JsonObject getLinkedTestCases​(int blockId)
    Retrieve all the test cases using the specified block
    (package private) javax.json.JsonObject getPlanDetails​(int planId)
    Returns all the plan details for the specified plan, including the expiration and number of ports
    (package private) java.lang.String getRecording​(int testResultId, int step)
    Makes an API call to get the recording for a given step.
    (package private) javax.json.JsonObject getStepRecordingAvailabilities​(int testResultId)
    Makes an API call to recordings available per step for a given test case result.
    (package private) javax.json.JsonObject getStepTranscription​(int testResultId, int step)
    Makes an API call to get the step transcription for any step in a voice call.
    (package private) javax.json.JsonObject getTestCaseBasics​(int testCaseId)
    Get the basic details for the supplied test case.
    (package private) javax.json.JsonObject getTestCaseResultByTicketId​(java.lang.String ticketId)
    Retrieve the results of a test case executed by the API
    (package private) javax.json.JsonObject getTestResultsFeed​(java.lang.String planType, java.lang.String fromType, java.lang.String fromRef)
    Retrieve up to 1000 calls occurring from the specified plan type since the specified date or result ID.
    (package private) javax.json.JsonObject importCXModel​(java.lang.String cxModelJson, java.lang.String createMode)
    Makes an API call to import CX Model Json into the specified account, and overwrite or create a new CX Model.
    (package private) javax.json.JsonObject importTestCaseFromFile​(java.lang.String xmlLocation)
    Takes in a valid Cyara XML file and imports it into the portal, creating a new test case or updating an existing one.
    (package private) javax.json.JsonObject importTestCaseFromString​(java.lang.String rawXML)
    Takes in a valid Cyara XML String and imports it into the portal, creating a new test case or updating an existing one.
    (package private) int linkDataset​(int datasetId, int testCaseId)
    Makes an API call to associate the specified dataset to the specified test case
    (package private) javax.json.JsonObject listAccounts()
    Makes an API call to list up to 1000 accounts the user is attached to.
    (package private) javax.json.JsonObject listBlocks()
    List up to 1000 blocks on the account
    (package private) javax.json.JsonObject listCXModels()
    Makes an API call to list up to 1000 CX Models located in the specified account
    (package private) javax.json.JsonObject listDashboards()
    Makes an API call to list up to 1000 Dashboards located in the specified account
    (package private) javax.json.JsonObject listDatasets​(java.lang.String dsSearchTerm)
    Makes an API call to list up to 1000 datasets located in the specified account
    (package private) javax.json.JsonObject listTestCases()
    List up to 1000 test cases on the account
    (package private) java.lang.String makeApiGet​(java.lang.String apiCall)
    Make an HTTPS GET call using Authorization and Json.
    (package private) java.lang.String makeApiGetWav​(java.lang.String apiCall)
    Make an HTTPS GET call using Authorization and Json to retrieve and download a .wav file
    (package private) javax.json.JsonObject makeApiPutPostDel​(java.lang.String httpMethod, java.lang.String apiCall, java.lang.String body, java.lang.String contentType)
    Make an HTTPS PUT/POST/DELETE call using Authorization and Json.
    void setAccountNum​(int accountNum)
    Sets the account number the boilerplate is using in all the API calls.
    (package private) javax.json.JsonObject updateDataset​(java.lang.String csvLocation, int datasetId)
    Takes in a valid .csv file and imports it into the portal, updating an existing, specified dataset.
    int write​(javax.sound.sampled.AudioInputStream stream, javax.sound.sampled.AudioFileFormat.Type fileType, java.io.File out)  
    int write​(javax.sound.sampled.AudioInputStream stream, javax.sound.sampled.AudioFileFormat.Type fileType, java.io.OutputStream out)  

    Methods inherited from class javax.sound.sampled.spi.AudioFileWriter

    isFileTypeSupported, isFileTypeSupported

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • baseUrl

      private java.lang.String baseUrl
    • accountNum

      private int accountNum
    • keyToken

      private java.lang.String keyToken
  • Constructor Details

    • ApiFunctionalities

      public ApiFunctionalities()
      The constructor to create the object. Gets all your credentials ready to go.
  • Method Details

    • getBaseUrl

      public java.lang.String getBaseUrl()
      Gets the Portal base Url the boilerplate is using. The boilerplate originally grabbed it from credentials.txt. Will be something like https://www.cyaraportal.us/
      Returns:
      The Url for the portal we're using
      Since:
      1.0
    • getAccountNum

      public int getAccountNum()
      Gets the account number the boilerplate is using in all the API calls. The boilerplate originally grabbed it from credentials.txt.
      Returns:
      The account number we're making all our APIs against
      Since:
      1.0
    • setAccountNum

      public void setAccountNum​(int accountNum)
      Sets the account number the boilerplate is using in all the API calls.
      Parameters:
      accountNum - The account number to change to
      Since:
      1.3
    • convertAPIOutputToJson

      javax.json.JsonObject convertAPIOutputToJson​(java.lang.String jsonStr)
      Convert a String object with Json format into a JsonObject
      Parameters:
      jsonStr - The Json String to convert into Json
      Returns:
      The JsonObject representation of the input String
      Since:
      1.0
    • convertStringToDocument

      org.w3c.dom.Document convertStringToDocument​(java.lang.String xmlStr)
      Convert a String object with XML format into an XMLDocument
      Parameters:
      xmlStr - The XML String to convert into XML
      Returns:
      The XMLDocument representation of the input String
      Since:
      1.0
    • makeApiGet

      java.lang.String makeApiGet​(java.lang.String apiCall)
      Make an HTTPS GET call using Authorization and Json.

      Used for 3.0 APIs

      Parameters:
      apiCall - The API endpoint to hit
      Returns:
      The String of the data sent back from the call
      Since:
      1.0
    • makeApiGetWav

      java.lang.String makeApiGetWav​(java.lang.String apiCall)
      Make an HTTPS GET call using Authorization and Json to retrieve and download a .wav file

      Used for 3.0 APIs

      Parameters:
      apiCall - The API endpoint to hit
      Returns:
      The downloaded audio file path
      Since:
      1.0
    • makeApiPutPostDel

      javax.json.JsonObject makeApiPutPostDel​(java.lang.String httpMethod, java.lang.String apiCall, java.lang.String body, java.lang.String contentType)
      Make an HTTPS PUT/POST/DELETE call using Authorization and Json.

      Used for 3.0 APIs

      Parameters:
      httpMethod - The type of call made, either PUT, POST, or DELETE
      apiCall - The API endpoint to hit
      body - Any json passed into the API request
      contentType - The type of data we're passing into the API
      Returns:
      The JsonObject of the data sent back from the call
      Since:
      1.0
    • datasetPutPostDel

      int datasetPutPostDel​(java.lang.String httpMethod, java.lang.String apiCall, java.lang.String body, java.lang.String contentType)
      Make an HTTPS PUT/POST/DELETE call using Authorization and Json. Used only for datasets because that API doesn't return anything.

      Used for 3.0 APIs

      Parameters:
      httpMethod - The type of call made, either PUT, POST, or DELETE
      apiCall - The API endpoint to hit
      body - Any json passed into the API request
      contentType - The type of data we're passing into the API
      Returns:
      The HTTP Status of the call
      Since:
      1.1
    • listAccounts

      javax.json.JsonObject listAccounts()
      Makes an API call to list up to 1000 accounts the user is attached to.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Accounts/Accounts_GetAccounts

      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getAccount

      javax.json.JsonObject getAccount()
      Makes an API call to return the account settings for the supplied account.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Accounts/Accounts_GetAccount

      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • listCXModels

      javax.json.JsonObject listCXModels()
      Makes an API call to list up to 1000 CX Models located in the specified account

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/CXModels/CXModels_GetModelsForAccount

      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • exportCXModel

      javax.json.JsonObject exportCXModel​(int cxModelId)
      Makes an API call to export the specified CX Model into CX Model Json

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/CXModels/CXModels_GetModelById

      Parameters:
      cxModelId - The ID of the CX Model to export
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • importCXModel

      javax.json.JsonObject importCXModel​(java.lang.String cxModelJson, java.lang.String createMode)
      Makes an API call to import CX Model Json into the specified account, and overwrite or create a new CX Model.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/CXModels/CXModels_CreateModel

      Parameters:
      cxModelJson - The json being imported to create the CX Model
      createMode - The type of import you want to do. Can be Default UniqueName OverrideExisting
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • listDashboards

      javax.json.JsonObject listDashboards()
      Makes an API call to list up to 1000 Dashboards located in the specified account

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Dashboards/Dashboards_GetDashboards

      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getDashboardFeed

      javax.json.JsonObject getDashboardFeed​(int dashboardId, int hours)
      Retrieves all the results and data used to create a Cyara Executive Dashboard up to the specified number of hours ago for the desired dashboard

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Dashboards/Dashboards_GetDashboardFeed

      Parameters:
      dashboardId - The ID of the dashboard whose feed we want
      hours - The amount of hours ago we grab data up to
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getDashboardTickers

      javax.json.JsonObject getDashboardTickers​(int dashboardId)
      Makes an API call to retrieve up to 1000 tickers that currently exist and are displayed for a given dashboard

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/DashboardTickers/DashboardTickers_GetDashboardTickers

      Parameters:
      dashboardId - The ID of the dashboard whose feed we want
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • listDatasets

      javax.json.JsonObject listDatasets​(java.lang.String dsSearchTerm)
      Makes an API call to list up to 1000 datasets located in the specified account

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_GetDatasetsForAccount

      Parameters:
      dsSearchTerm - The substring DS name to filter by
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getDataset

      javax.json.JsonObject getDataset​(int datasetId)
      Makes an API call to return a specified dataset, including the headers and number of scenarios

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_GetDatasetsForAccount

      Parameters:
      datasetId - The ID of the dataset to retrieve
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getDatasetRows

      javax.json.JsonObject getDatasetRows​(int datasetId)
      Makes an API call to return up to 1000 scenarios (rows) for a specified dataset,

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_GetDataRows

      Parameters:
      datasetId - The ID of the dataset to retrieve rows for
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getDatasetTestCases

      javax.json.JsonObject getDatasetTestCases​(int datasetId)
      Makes an API call to return up to 1000 test cases currently using the specified dataset

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_DatasetUsage

      Parameters:
      datasetId - The ID of the dataset to find usages for
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • linkDataset

      int linkDataset​(int datasetId, int testCaseId)
      Makes an API call to associate the specified dataset to the specified test case

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_LinkTestCaseWithDataset

      Parameters:
      datasetId - The ID of the dataset to link to the test case
      testCaseId - The ID of the test case to associate with the dataset
      Returns:
      The HTTP Status of the call
      Since:
      1.0
    • deleteDataset

      javax.json.JsonObject deleteDataset​(int datasetId)
      Permanently and irreversibly deletes the single, specified dataset

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_DeleteDatasetFromAccount

      Parameters:
      datasetId - The ID of the dataset to delete
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • deleteDatasets

      javax.json.JsonObject deleteDatasets​(java.lang.String datasetIds)
      Permanently and irreversibly deletes all the specified datasets

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_DeleteDatasetsFromAccount

      Parameters:
      datasetIds - The IDs of the datasets to delete in the form of "[146,147]"
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • createDataset

      javax.json.JsonObject createDataset​(java.lang.String csvLocation)
      Takes in a valid .csv file and imports it into the portal, creating a brand new dataset

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_AddDatasetToAccount

      Parameters:
      csvLocation - The filepath of your .csv file
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • updateDataset

      javax.json.JsonObject updateDataset​(java.lang.String csvLocation, int datasetId)
      Takes in a valid .csv file and imports it into the portal, updating an existing, specified dataset. Replaces all the existing content in the dataset with the .csv content

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Datasets/Datasets_ReplaceDataset

      Parameters:
      csvLocation - The filepath of your .csv file
      datasetId - The ID of the dataset to update
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • importTestCaseFromFile

      javax.json.JsonObject importTestCaseFromFile​(java.lang.String xmlLocation)
      Takes in a valid Cyara XML file and imports it into the portal, creating a new test case or updating an existing one. A new test case is create if the folder name and test case name combination doesn't exist. Otherwise, the existing test case is updated.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestCases/TestCases_ImportTestCases

      Parameters:
      xmlLocation - The filepath of your .xml file
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • importTestCaseFromString

      javax.json.JsonObject importTestCaseFromString​(java.lang.String rawXML)
      Takes in a valid Cyara XML String and imports it into the portal, creating a new test case or updating an existing one. A new test case is create if the folder name and test case name combination doesn't exist. Otherwise, the existing test case is updated.

      This call is not yet documented in Swagger

      Parameters:
      rawXML - The XML String of the test case to import
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • filePutPost

      javax.json.JsonObject filePutPost​(java.lang.String httpMethod, java.lang.String apiCall, java.lang.String fileLocation, java.lang.String fileType)
      Makes an HTTP PUT or POST with a file attached as part of the call
      Parameters:
      httpMethod - The type of call made, either PUT or POST
      apiCall - The API endpoint to hit
      fileLocation - The filepath of the file to attach to the HTTP request
      fileType - The type of file we're passing into the request
      Returns:
      The JsonObject of the data sent back from the call
      Since:
      1.0
    • exportTestCases

      java.lang.String exportTestCases​(java.util.ArrayList<java.lang.Integer> testCaseIds, java.lang.String blockOption)
      Exports one or more test cases as Cyara XML

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestCases/TestCases_GetCyaraXml

      Parameters:
      testCaseIds - The IDs of all the test cases to export
      blockOption - How to export the blocks the test cases are using IncludeBlocks ExcludeBlocks FlattenBlocks
      Returns:
      The String Cyara XML of the exported test cases
      Since:
      1.0
    • exportTestCase

      java.lang.String exportTestCase​(int testCaseId, java.lang.String blockOption)
      Exports a single test case as Cyara XML
      Parameters:
      testCaseId - The ID of the test case to export
      blockOption - How to export the blocks the test case is using IncludeBlocks ExcludeBlocks FlattenBlocks
      Returns:
      The String Cyara XML of the exported test case
      Since:
      1.0
      See Also:
      exportTestCases(java.util.ArrayList<java.lang.Integer>,java.lang.String)
    • exportBlocks

      java.lang.String exportBlocks​(java.util.ArrayList<java.lang.Integer> blockIds)
      Exports one or more blocks as Cyara XML

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Blocks/Blocks_GetCyaraXml

      Parameters:
      blockIds - The IDs of all the blocks to export
      Returns:
      The String Cyara XML of the exported blocks
      Since:
      1.0
    • exportBlock

      java.lang.String exportBlock​(int blockId)
      Exports a single block as Cyara XML
      Parameters:
      blockId - The ID of the block to export
      Returns:
      The String Cyara XML of the exported block
      Since:
      1.0
      See Also:
      exportBlocks(java.util.ArrayList<java.lang.Integer>)
    • getTestCaseBasics

      javax.json.JsonObject getTestCaseBasics​(int testCaseId)
      Get the basic details for the supplied test case.

      Does not export as Cyara XML.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestCases/TestCases_GetTestCase

      Parameters:
      testCaseId - The ID of the test case to get information on
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
      See Also:
      exportTestCase(int,java.lang.String)
    • getLinkedTestCases

      javax.json.JsonObject getLinkedTestCases​(int blockId)
      Retrieve all the test cases using the specified block

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Blocks/Blocks_GetLinkedTestCaseDetailsByBlockId

      Parameters:
      blockId - The ID of the block to check usage on
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getTestResultsFeed

      javax.json.JsonObject getTestResultsFeed​(java.lang.String planType, java.lang.String fromType, java.lang.String fromRef)
      Retrieve up to 1000 calls occurring from the specified plan type since the specified date or result ID. The calls will be returned with every step of every call and every detail of every step of every call.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestResults/TestResults_GetTestResultsFeed

      Parameters:
      planType - The plan type to retrieve calls for
      fromType - The choice to use a date or result ID to grab results from
      fromRef - The earliest date or result ID to grab calls from. Can be fromDate or fromTestResultId. If using fromDate, formats can be 2020-04-01T12:00:00-05:00 or 2020-02-14T15:25:56Z or 2020-05-15T05:15:27.048638600Z
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • executeCampaign

      javax.json.JsonObject executeCampaign​(int campaignId)
      Immediately starts the specified campaign

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Campaigns/Campaigns_CampaignExecute

      Parameters:
      campaignId - The ID of the campaign to run
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getCampaignRunByCampaignRunId

      javax.json.JsonObject getCampaignRunByCampaignRunId​(int campaignId, java.lang.String campaignRunId)
      Gets the status of a campaign run

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/CampaignRuns/CampaignRuns_GetCampaignRun

      Parameters:
      campaignId - The ID of the campaign we're running
      campaignRunId - The GUID for the campaign execution
      Returns:
      The JsonObject of what the API returned
      Since:
      1.5
    • getCampaignRunTestStepResults

      javax.json.JsonObject getCampaignRunTestStepResults​(int campaignId, int runId)
      Gets the results of a campaign run

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Reports/Reports_GetCampaignRunTestResults

      Parameters:
      campaignId - The ID of the campaign whose results we want
      runId - The ID for the campaign run's report
      Returns:
      The JsonObject of what the API returned
      Since:
      1.5
    • getCampaignRunHistory

      javax.json.JsonObject getCampaignRunHistory​(int campaignId)
      Gets the run history of a campaign

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Campaigns/Campaigns_GetCampaignRunHistory

      Parameters:
      campaignId - The ID of the campaign we're running
      Returns:
      The JsonObject of what the API returned
      Since:
      1.5
    • getTestCaseResultByTicketId

      javax.json.JsonObject getTestCaseResultByTicketId​(java.lang.String ticketId)
      Retrieve the results of a test case executed by the API

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestResults/TestResults_GetTestResultByTicketId

      Parameters:
      ticketId - The ticket ID of the test case run used by the portal
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
      See Also:
      executeTestCase(int)
    • executeTestCase

      javax.json.JsonObject executeTestCase​(int testCaseId)
      Runs the test case as a single validation run

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestCases/TestCases_ExecuteTestCase

      Parameters:
      testCaseId - The ID of the test case to run
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
      See Also:
      getTestCaseResultByTicketId(java.lang.String)
    • listBlocks

      javax.json.JsonObject listBlocks()
      List up to 1000 blocks on the account

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Blocks/Blocks_GetBlockListByAccount

      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • listTestCases

      javax.json.JsonObject listTestCases()
      List up to 1000 test cases on the account

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestCases/TestCases_GetTestCases

      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • getPlanDetails

      javax.json.JsonObject getPlanDetails​(int planId)
      Returns all the plan details for the specified plan, including the expiration and number of ports

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Plans/Plans_GetPlan

      Parameters:
      planId - The ID of the plan to retrieve details for
      Returns:
      The JsonObject of what the API returned
      Since:
      1.0
    • createCampaign

      javax.json.JsonObject createCampaign​(java.lang.String campaignJson)
      Creates a campaign using the 3.0 API

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/Campaigns/Campaigns_CreateCampaign

      Parameters:
      campaignJson - The configuration of the campaign we're building
      Returns:
      The JsonObject of what the API returned
      Since:
      1.1
    • getStepRecordingAvailabilities

      javax.json.JsonObject getStepRecordingAvailabilities​(int testResultId)
      Makes an API call to recordings available per step for a given test case result.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestResults/TestResults_GetCallRecordingList

      Parameters:
      testResultId - The ID of the voice test case result
      Returns:
      The JsonObject of what the API returned
      Since:
      1.3
    • getRecording

      java.lang.String getRecording​(int testResultId, int step)
      Makes an API call to get the recording for a given step.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TestResults/TestResults_GetFullCallRecording

      Parameters:
      testResultId - The ID of the voice test case result
      step - The step whose recording to retrieve
      Returns:
      The downloaded audio file path
      Since:
      1.3
    • getStepTranscription

      javax.json.JsonObject getStepTranscription​(int testResultId, int step)
      Makes an API call to get the step transcription for any step in a voice call.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TranscriptionProxy/TranscriptionProxy_GetTranscription

      Parameters:
      testResultId - The ID of the voice test case result
      step - The step whose transcription to retrieve
      Returns:
      The JsonObject of what the API returned
      Since:
      1.3
    • generateStepTranscription

      javax.json.JsonObject generateStepTranscription​(int testResultId, int step)
      Makes an API call to generate the step transcription for any step in a voice call.

      https://www.cyaraportal.us/cyarawebapi/swagger/index.html?url=/cyarawebapi/swagger/v3/swagger.json#/TranscriptionProxy/TranscriptionProxy_Transcribe

      Parameters:
      testResultId - The ID of the voice test case result
      step - The step whose transcription to retrieve
      Returns:
      The JsonObject of what the API returned
      Since:
      1.3
    • getAudioFileTypes

      public javax.sound.sampled.AudioFileFormat.Type[] getAudioFileTypes()
      Specified by:
      getAudioFileTypes in class javax.sound.sampled.spi.AudioFileWriter
    • getAudioFileTypes

      public javax.sound.sampled.AudioFileFormat.Type[] getAudioFileTypes​(javax.sound.sampled.AudioInputStream stream)
      Specified by:
      getAudioFileTypes in class javax.sound.sampled.spi.AudioFileWriter
    • write

      public int write​(javax.sound.sampled.AudioInputStream stream, javax.sound.sampled.AudioFileFormat.Type fileType, java.io.OutputStream out) throws java.io.IOException
      Specified by:
      write in class javax.sound.sampled.spi.AudioFileWriter
      Throws:
      java.io.IOException
    • write

      public int write​(javax.sound.sampled.AudioInputStream stream, javax.sound.sampled.AudioFileFormat.Type fileType, java.io.File out) throws java.io.IOException
      Specified by:
      write in class javax.sound.sampled.spi.AudioFileWriter
      Throws:
      java.io.IOException