Select programming language for code examples

linkPlatforms

Platforms are automatically populated by the current releases and their artifacts. The below endpoints are read-only.

linkThe platform object

Below you will find the various attributes for the platform resource.

linkAttributes

  • linkdata.attributes.name

    stringread only

    The human-readable name of the platform. This can be used as an optional label.

  • linkdata.attributes.key

    stringread only

    The machine-readable key of the platform.

  • linkdata.attributes.created

    timestamp (iso8601)read only

    When the platform was created.

  • linkdata.attributes.updated

    timestamp (iso8601)read only

    When the platform was last updated.

linkRelationships

  • linkdata.relationships.account

    individual

    The account that the platform belongs to.

Example object

{
"data": {
"id": "dc355100-2d5e-4b3c-a638-a96a4b162052",
"type": "platforms",
"attributes": {
"name": "macOS",
"key": "darwin",
"created": "2021-05-14T15:16:21.898Z",
"updated": "2021-05-14T15:16:21.898Z"
},
"relationships": {
"account": {
"links": {
"related": "/v1/accounts/<account>"
},
"data": {
"type": "accounts",
"id": "<account>"
}
}
},
"links": {
"related": "/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052"
}
}
}

linkRetrieve a platform

Retrieves the details of an existing platform.

linkAuthentication

  • linkBearer

    optional

    An authentication token with privileges to read the platform: either an admin, the product it belongs to, an entitled license (via license key or a license token), or a user with an entitled license. If there are products with an OPEN distribution strategy, no authentication is required to read their associated platforms.

linkURL Parameters

  • link<account>

    stringrequired

    The identifier (UUID) or slug of your Keygen account.

  • link<platform>

    stringrequired

    The identifier (UUID) of the platform to be retrieved.

linkReturns

A 200 OK response will be returned along with a platform object.

Upon error, an errors object will be returned along with an HTTP status code indicating the type of error. When an error occurs, the data property will not be included.

Definition

https://api.keygen.sh/v1/accounts/<account>/platforms/<platform>

Example request

const fetch = require("node-fetch")
 
const response = await fetch("https://api.keygen.sh/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Accept": "application/vnd.api+json"
}
})
 
const { data, errors } = await response.json()
import requests
import json
 
res = requests.get(
"https://api.keygen.sh/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052",
headers={
"Authorization": "Bearer <token>",
"Accept": "application/vnd.api+json"
}
).json()
import SwiftyJSON
import Alamofire
 
Alamofire.request("https://api.keygen.sh/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052",
headers: [
"Authorization": "Bearer <token>",
"Accept": "application/vnd.api+json"
]
).responseJSON { response in
let json = JSON(data: response.data!)
}
using RestSharp;
 
var client = new RestClient("https://api.keygen.sh/v1/accounts/<account>");
var request = new RestRequest(
"platforms/dc355100-2d5e-4b3c-a638-a96a4b162052",
Method.GET
);
 
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Accept", "application/vnd.api+json");
 
var response = client.Execute(request);
import com.mashape.unirest.http.exceptions.*
import com.mashape.unirest.http.*
 
val res = Unirest.get("https://api.keygen.sh/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052")
.header("Authorization", "Bearer <token>")
.header("Accept", "application/vnd.api+json")
.asJson()
import com.mashape.unirest.http.exceptions.*;
import com.mashape.unirest.http.*;
 
HttpResponse<JsonNode> res = Unirest.get("https://api.keygen.sh/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052")
.header("Authorization", "Bearer <token>")
.header("Accept", "application/vnd.api+json")
.asJson();
#include <iostream>
#include <string>
#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
 
using namespace std;
using namespace web;
using namespace web::http;
using namespace web::http::client;
using namespace utility;
 
http_client client("https://api.keygen.sh/v1/accounts/<account>");
http_request req;
 
req.headers().add("Authorization", "Bearer <token>");
req.headers().add("Accept", "application/json");
 
req.set_request_uri("/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052");
req.set_method(methods::GET);
 
client.request(req)
.then([](http_response res) {
auto data = res.extract_json().get();
})
.wait();
curl https://api.keygen.sh/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052 \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/vnd.api+json'

Example response / 200 OK

{
"data": {
"id": "dc355100-2d5e-4b3c-a638-a96a4b162052",
"type": "platforms",
"attributes": {
"name": "macOS",
"key": "darwin",
"created": "2021-05-14T15:16:21.898Z",
"updated": "2021-05-14T15:16:21.898Z"
},
"relationships": {
"account": {
"links": {
"related": "/v1/accounts/<account>"
},
"data": {
"type": "accounts",
"id": "<account>"
}
}
},
"links": {
"related": "/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052"
}
}
}

linkList all platforms

Returns a list of platforms. The platforms are returned sorted by creation date, with the most recent platforms appearing first.

linkAuthentication

  • linkBearer

    optional

    An authentication token with privileges to read the platforms: either an admin, the product the releases belong to, an entitled license (via license key or a license token), or a user with an entitled license. If there are products with an OPEN distribution strategy, no authentication is required to read their associated platforms.

linkURL Parameters

  • link<account>

    stringrequired

    The identifier (UUID) or slug of your Keygen account.

linkQuery Parameters

  • linklimit

    integerdefault=10

    A limit on the number of platforms to be returned. Limit must be a number between 1 and 100.

    /v1/accounts/<account>/platforms?limit=25
  • linkpage

    object<string, integer>

    Object containing page size and page number. Page size must be a number between 1 and 100.

    /v1/accounts/<account>/platforms?page[size]=15&page[number]=2

linkReturns

A 200 OK response will be returned along with a list of platform objects.

Upon error, an errors object will be returned along with an HTTP status code indicating the type of error. When an error occurs, the data property will not be included.

Definition

https://api.keygen.sh/v1/accounts/<account>/platforms

Example request

const fetch = require("node-fetch")
 
const response = await fetch("https://api.keygen.sh/v1/accounts/<account>/platforms?limit=15", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Accept": "application/vnd.api+json"
}
})
 
const { data, errors } = await response.json()
import requests
import json
 
res = requests.get(
"https://api.keygen.sh/v1/accounts/<account>/platforms?limit=15",
headers={
"Authorization": "Bearer <token>",
"Accept": "application/vnd.api+json"
}
).json()
import SwiftyJSON
import Alamofire
 
Alamofire.request("https://api.keygen.sh/v1/accounts/<account>/platforms?limit=15",
headers: [
"Authorization": "Bearer <token>",
"Accept": "application/vnd.api+json"
]
).responseJSON { response in
let json = JSON(data: response.data!)
}
using RestSharp;
 
var client = new RestClient("https://api.keygen.sh/v1/accounts/<account>");
var request = new RestRequest("platforms", Method.GET);
 
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Accept", "application/vnd.api+json");
 
request.AddParameter("limit", 15);
 
var response = client.Execute(request);
import com.mashape.unirest.http.exceptions.*
import com.mashape.unirest.http.*
 
val res = Unirest.get("https://api.keygen.sh/v1/accounts/<account>/platforms")
.header("Authorization", "Bearer <token>")
.header("Accept", "application/vnd.api+json")
.queryString("limit", 15)
.asJson()
import com.mashape.unirest.http.exceptions.*;
import com.mashape.unirest.http.*;
 
HttpResponse<JsonNode> res = Unirest.get("https://api.keygen.sh/v1/accounts/<account>/platforms")
.header("Authorization", "Bearer <token>")
.header("Accept", "application/vnd.api+json")
.queryString("limit", 15)
.asJson();
#include <iostream>
#include <string>
#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
 
using namespace std;
using namespace web;
using namespace web::http;
using namespace web::http::client;
using namespace utility;
 
http_client client("https://api.keygen.sh/v1/accounts/<account>");
http_request req;
 
req.headers().add("Authorization", "Bearer <token>");
req.headers().add("Accept", "application/json");
 
uri_builder uri("/platforms");
uri.append_query("limit", 15);
 
req.set_request_uri(uri.to_uri());
req.set_method(methods::GET);
 
client.request(req)
.then([](http_response res) {
auto data = res.extract_json().get();
})
.wait();
curl https://api.keygen.sh/v1/accounts/<account>/platforms?limit=15 -g \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/vnd.api+json'

Example response / 200 OK

{
"data": [
{
"id": "86e4cfd9-b470-4a9a-aa2d-89a6c1e52bdf",
"type": "platforms",
"attributes": {
"name": "Linux",
"key": "linux",
"created": "2021-05-19T15:12:25.602Z",
"updated": "2021-05-19T15:12:25.602Z"
},
"relationships": {
"account": {
"links": {
"related": "/v1/accounts/<account>"
},
"data": {
"type": "accounts",
"id": "<account>"
}
}
},
"links": {
"related": "/v1/accounts/<account>/platforms/86e4cfd9-b470-4a9a-aa2d-89a6c1e52bdf"
}
},
{
"id": "a79e772c-4610-4fd1-b3df-44b67f0dd472",
"type": "platforms",
"attributes": {
"name": "Windows",
"key": "windows",
"created": "2021-05-17T21:00:22.245Z",
"updated": "2021-05-17T21:00:22.245Z"
},
"relationships": {
"account": {
"links": {
"related": "/v1/accounts/<account>"
},
"data": {
"type": "accounts",
"id": "<account>"
}
}
},
"links": {
"related": "/v1/accounts/<account>/platforms/a79e772c-4610-4fd1-b3df-44b67f0dd472"
}
},
{
"id": "dc355100-2d5e-4b3c-a638-a96a4b162052",
"type": "platforms",
"attributes": {
"name": "macOS",
"key": "darwin",
"created": "2021-05-14T15:16:21.898Z",
"updated": "2021-05-14T15:16:21.898Z"
},
"relationships": {
"account": {
"links": {
"related": "/v1/accounts/<account>"
},
"data": {
"type": "accounts",
"id": "<account>"
}
}
},
"links": {
"related": "/v1/accounts/<account>/platforms/dc355100-2d5e-4b3c-a638-a96a4b162052"
}
}
]
}