Skip to main content
GET
/
subscriptions
/
{platformType}
/
{subscriptionRef}
Get subscription results (on-demand)
curl --request GET \
  --url https://{host}/subscriptions/{platformType}/{subscriptionRef}
import requests

url = "https://{host}/subscriptions/{platformType}/{subscriptionRef}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://{host}/subscriptions/{platformType}/{subscriptionRef}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/subscriptions/{platformType}/{subscriptionRef}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://{host}/subscriptions/{platformType}/{subscriptionRef}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{host}/subscriptions/{platformType}/{subscriptionRef}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{host}/subscriptions/{platformType}/{subscriptionRef}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "subscription": {
    "name": "Sample Subscription",
    "description": "A subscription for testing",
    "created": "Mon Jan 19 13:52:31 EST 2020",
    "createdBy": "saas",
    "updated": "Mon Jan 20 14:32:38 EST 2020",
    "updatedBy": "SaaSadmin",
    "lastRefreshed": "Mon Jan 20 01:32:59 EST 2020",
    "owner": "saas"
  },
  "count": 452,
  "results": [
    {
      "currentType": "standard_d2",
      "name": "st01-prepro-edge-307",
      "recommendationType": "Modernize - Optimal Family",
      "savingsEstimate": "43.850475",
      "serviceType": "Virtual Machine",
      "divider": "------------------------",
      "Availability Zone": "eastus+group"
    }
  ]
}
{
"message": "On-Demand Failure. The return count of 3891 has exceeded object return limit of 3000. Update your call with a new limit value. Wed Jul 29 09:05:15 EDT 2020",
"status": 400
}

Path Parameters

platformType
enum<string>
required

Technology platform for the subscription results.

Available options:
cloud,
containers
subscriptionRef
string
required

Unique subscription identifier.

Query Parameters

divider
enum<string>
default:true

Display divider between properties and tags in each result: "true" (default) shows "divider": "------------------------", "false" hides it.

Available options:
true,
false
limit
integer
default:3000

Maximum number of results to return. Default 3000; valid range 1–30000. Only applies to on-demand queries (no limit for scheduled webhook pushes).

Required range: 1 <= x <= 30000

Response

Subscription results

subscription
object
required
count
integer
required

Number of recommendations in results.

results
object[]
required