Content & Malware Analysis

 View Only
  • 1.  Using CAS API with curl under Linux

    Posted Aug 25, 2021 02:46 AM
    Hi,

    I tried to play around with the CAS API running OS 3.1 but all my tries end up in status "unauthorzized"

    Easy things like /rapi/tasks/<id> are not working. The only way I was able to get an answer from API was using a browser, but I needed to logon in an extra tab to get a response. Just entering the URL in browser also ended up in an 401 unauthoried.

    Anyone has experience with using the CAS API to tell me the secret how to access it?

    Thanks in advance,
    Sascha


  • 2.  RE: Using CAS API with curl under Linux

    Posted Aug 25, 2021 03:38 AM
    Hi,

    RTFM helped, I resolved this by mself, you need to create an API key and use it with

    curl -H "X-API-TOKEN:<api-key>" https://mag2host/rapi/tasks

    For example, if the API key is a2f26f1c84084eb4b1c4a694aa8ae9e6:

    curl -H "X-API-TOKEN:a2f26f1c84084eb4b1c4a694aa8ae9e6" https://mag2host/rapi/tasks

    So if someone runs into the same issue, the solution is easy.



    Cheers,
    Sascha