Newbie in Rest use

Last post 01-20-2021, 7:38 PM by Anthony.Hodges. 8 replies.
Sort Posts: Previous Next
  • Newbie in Rest use
    Posted: 01-12-2021, 6:46 AM

    Hi,

    I've been using QLogin to send restore requests via a powerbuilder application until now, but somehow it dont work anymore and I have to try to use REST requests but even after reading 10 times the documentation I dont succeed to login using the Postman application.

    here is my POST request, if someone can tell me what is wrong in it, I'd be very pleased :

    http://wmrcsbk01:81/SearchSvc/CVWebService.svc/Login HTTP/1.1 <== this I'm not sure
    Host: wmrcsbk01:81 <== this I'm not sure also
    Accept: application/json
    Content-type: application/json
    {
    "domain":"---------",
    "username":"-----------",
    "password":"------",
    "commserver":"csbk" <== and this I dont know what it means
    }
    Result : Error: getaddrinfo ENOTFOUND searchsvc
     
  • Re: Newbie in Rest use
    Posted: 01-13-2021, 7:45 AM

    Hi,

    if I need to Login with Postman, all I need to enter ist this:
    http://nameofcommvaultwebserver/webconsole/api
    As authentification I use a QSDK Token.

    Regards

    Thomas

  • Re: Newbie in Rest use
    Posted: 01-14-2021, 2:55 AM

    Hi, I have used the Rest API via Postman a while back.  However like yourself, when I follow the documentation i cannot log in - although in my case it says the Base64 password is invalid (errorcide 1116).  Tried via Postman and CURL (tried the HTTPS webconsole/api and WebService URL).  Perhaps someone else can chime in?

  • Re: Newbie in Rest use
    Posted: 01-18-2021, 2:04 PM

    Hi,

     

    Finally I succeed to get an answer but it ends always with error 1117 : Wrong user/passw.

  • Re: Newbie in Rest use
    Posted: 01-19-2021, 3:00 AM

    Using this works for me:

    POST https://<CommServeFQDN>/webconsole/api/Login
    {
        "username":"admin",
        "password":"<Base64 encoded Password>"
    }

    maybe you tried to use plaintext password instead of base64 encoded?

    recommend to use the webconsole-api, one less port open in firewall.

    Another issue I stumbled over in the beginning was that /Login gives you a "token"-ReturnValue wiht QSDK Token, but all other APIs expect an "Authtoken"-Field in Header with that Value.

  • Re: Newbie in Rest use
    Posted: 01-19-2021, 7:22 PM

    Hi Zion_Assedo,

    Are you doing an Unicode Base64 encode of the password, because you must do an ASCII Base64 Encode? For Example, in PowerShell you don't encode like this

    $password = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes('MyPassword'))

    But rather,

    $password = [Convert]::ToBase64String([Text.Encoding]::Ascii.GetBytes('MyPassword'))

    Also, are you using a Domain username and password - if try so try just using a non-LDAP username and password registered in Commvault.

     

  • Re: Newbie in Rest use
    Posted: 01-20-2021, 1:20 AM

    Well, I'm using the string that is generated in the bat file when I ask for a script, it works fine using Qlogin, is it not a base 64 ?

  • Re: Newbie in Rest use
    Posted: 01-20-2021, 7:21 AM

    Thanks a lot Anthony, I finally succeed to have my connection !

  • Re: Newbie in Rest use
    Posted: 01-20-2021, 7:38 PM

    Yeah that one is not Base64. Would have saved a bit of hassle if it was the same.  When I did my brief test earlier I realised that it was only failing because I had converted my password to unicode. Glad you got in!

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2021 Commvault | All Rights Reserved. | Legal | Privacy Policy