Download URLs for Central tenants

Hello,

Between this: https://developer.sophos.com/docs/endpoint-v1/1/routes/downloads/get

and this: https://developer.sophos.com/getting-started

I got as far as trying to submit a 'curl' command to get the downloadURL value for a given tenant. I wouldn't even be bothering but the thin-installer deployment page makes a prominent note of saying "hey, use the API instead" without actually giving a concrete example of HOW to use the API.

But my results are...

{
  "tenant": {
    "id": "ID REDACTED"
  },
  "licensedProducts": [],
  "installers": []
}

Not helpful. What am I missing?

Thanks,

- KPK

Parents
  • FormerMember
    0 FormerMember

    Hi,

    The primary thing is that you need to get the tenant id and data region. 

    The curl call will look like this:

    curl \
    'api-us01.central.sophos.com/.../downloads \
    --header 'X-Tenant-ID: 0de7...b683' \
    --header 'Authorization: Bearer eyJ...JU' \
    --header 'Accept: application/json' \
    --compressed

    This is for the product set requested - modify as you see fit. 

    In the https section the us01 is specific to this account and you need to get that from this call:

    curl -XGET -H "Authorization: Bearer <jwt>" https://api.central.sophos.com/whoami/v1

    If you are a direct tenant.

    If the account is under an Enterprise Dashboard or Partner Portal - you need to list tenants first to get the tenant id:
    curl -XGET -H "Authorization: Bearer <jwt>" \
               -H "X-Organization-ID: <organization-id>" \
                    api.central.sophos.com/.../tenants

    This will return an array with the tenant ids and their data regions. Just slot that into the call above to get the download.
    Remember, your API account need access to these lower levels for the call to work.
Reply
  • FormerMember
    0 FormerMember

    Hi,

    The primary thing is that you need to get the tenant id and data region. 

    The curl call will look like this:

    curl \
    'api-us01.central.sophos.com/.../downloads \
    --header 'X-Tenant-ID: 0de7...b683' \
    --header 'Authorization: Bearer eyJ...JU' \
    --header 'Accept: application/json' \
    --compressed

    This is for the product set requested - modify as you see fit. 

    In the https section the us01 is specific to this account and you need to get that from this call:

    curl -XGET -H "Authorization: Bearer <jwt>" https://api.central.sophos.com/whoami/v1

    If you are a direct tenant.

    If the account is under an Enterprise Dashboard or Partner Portal - you need to list tenants first to get the tenant id:
    curl -XGET -H "Authorization: Bearer <jwt>" \
               -H "X-Organization-ID: <organization-id>" \
                    api.central.sophos.com/.../tenants

    This will return an array with the tenant ids and their data regions. Just slot that into the call above to get the download.
    Remember, your API account need access to these lower levels for the call to work.
Children