Skip to main content

Authentication

Comments

10 comments

  • Pritheevraj Sundararaj

    I Would like to see more example for this API

    0
  • Valery Topilin

    Thanks for your feedback! Are you looking for a specific programming language?

    Please let us know.

    -1
  • Stuart Pennington

    I would like to see more examples for the API we are using Python

    1
  • Daniel haynes

    Thanks for the feedback! What API examples are you looking for, or was there a specific task you were looking to complete using the Cyara API and a Python script?

    Please let me know and I will follow this up with the team.

    1
  • Stuart Pennington

    I am currently looking to migrate from our on-prem cyara instance to a new cloud instance that we have. we currently have approx 11k test cases to migrate as well as something like 60 user accounts that need to be moved over. After looking at the swagger it seems that the import request is limited to about 1k test cases. We currently have an internal tool we have built to export the cyara test case results to a different software the business uses. Is there a way to make this process simple without the need to build out a special tool for it?

    0
  • Valery Topilin

    I sent you a code example on how to import thousands of test cases using the API. The idea is quite simple: parse it and import individually.

    Unfortunately, I couldn't test it with the file as big as yours, but it should work. Please let us know how it goes and we will publish the code in our examples section.

    0
  • Stuart Pennington

    I would like to see more documentation on integrating with your SSO implementation. 

    1
  • Valery Topilin

    Hi Stuart!

    SSO is a different topic. I will be happy to help you with it. I will convert your question into the support ticket.

    Thanks!

    0
  • Kashif Akhter

    Hi ,

    Could you please share the code how Cyara authentication can be done for API requests in powershell. Since when I am trying to use the code as explained in your topic I am getting below error. I have added the code and outcome below for your reference.

     

    powershell code:

    >>$header = @{
            "Authorization" = "ApiKey  [Insert API key here from Cyara user account]"
            }

    >>$param = @{
            ContentType = "multipart/form-data"
            Method      = "Get"
            Uri         = "https://cat.cyara.com/cyarawebapi/v3.0/accounts/[insert Cyara login user name]/testcases"     
        }

    >>Invoke-RestMethod @param -Headers @header 

     

    Error that is showing when executing above code;

     

    Invoke-RestMethod : {"message":"No access to specified account"}
    At line:1 char:11
    + Invoke-RestMethod @param -Headers @{
    +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], We
       eption
        + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
    0
  • Valery Topilin

    It seems that the error caused not by the authentication, but the way you use the API call. Instead of the AccountID, which is, essentially the customer instance in the Cyara portal, you're trying to use username:

    https://cat.cyara.com/cyarawebapi/v3.0/accounts/[insert Cyara login user name]/testcases" 

    You need to use something like this:

    https://cat.cyara.com/cyarawebapi/v3.0/accounts/[insert Cyara Account ID]/testcases" 

    AccountID is the account id in the Cyara portal URL. For example:

    https://www.cyaraportal.us/cyarawebportal/1/home
    0

Please sign in to leave a comment.