How to get license id ?
Hi,
I want to use the assignSiteBwLicense mutation to automate site licensing, but I cannot find the correct licenseId to pass in the input.
Mutation I want to use:
mutation assignSiteBwLicense($accountId: ID!, $input: AssignSiteBwLicenseInput!) { sites(accountId: $accountId) { assignSiteBwLicense(input: $input) { license { __typename id sku ... on SiteLicense { site { id } total } } } } }
Variables:
{ "accountId": "123", "input": { "site": { "input": "123" }, // <-- I have the correct Site ID and Account ID
"licenseId": "???", // <-- MISSING: How to find this ID?
Troubleshooting steps:
- I tried using the pool ID seen in browser debug ("4436"), but the mutation returns "internal upstream error".
- I tried listing licenses via licensing { bwLicenses } but the query fails (field does not exist).
- I tried accountManagement { licenses } but it returns empty or generic IDs.
Question:
Which query should I use to get the specific licenseId required for this mutation?
Thanks for your help
You can normally use a licensingInfo query to retrieve the ID of the pool licence. I say normally because depending on your accounts configuration licence application via API may not be possible if it contains certain regional licences.
query licensingInfo($accountId: ID!) {
licensing(accountId: $accountId) {
licensingInfo {
pooledBandwidth {
id
sku
plan
status
expirationDate
startDate
total
siteLicenseGroup
siteLicenseType
}
}
}
}