Sure. I grabbed myself a Personal Access Token via account.smartthings.com/tokens (I used one with ‘customcapabilities’ scope, I don’t know what scopes are actually required) and then, replacing TOKEN with the actual UUID, I did:
curl --header "Authorization: Bearer TOKEN" https://api.smartthings.com/v1/capabilities
That spews out JSON listing all the capabilities, giving ID, version and status. Then, using the ID (imageCapture
) and version (1
):
curl --header "Authorization: Bearer TOKEN" https://api.smartthings.com/v1/capabilities/imageCapture/1
That gives the specifics as JSON. Formatted they look like:
{
"id": "imageCapture",
"version": 1,
"status": "live",
"name": "Image Capture",
"attributes": {
"image": {
"schema": {
"type": "object",
"properties": {
"value": {
"title": "URL",
"type": "string",
"pattern": "^(https?):\\/\\/((?:[a-zA-Z0-9.-]|%[0-9A-F]{2}){3,})(?::(\\d+))?((?:\\/(?:[a-z0-9-._~!$&'()*+,;=:@]|%[0-9A-F]{2})*)*)(?:\\?((?:[a-zA-Z0-9-._~!$&'()*+,;=:\\/?@]|%[0-9A-F]{2})*))?(?:#((?:[a-zA-Z0-9-._~!$&'()*+,;=:\\/?@]|%[0-9A-F]{2})*))?$"
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"setter": "take",
"enumCommands": []
},
"captureTime": {
"schema": {
"type": "object",
"properties": {
"value": {
"title": "Iso8601Date",
"type": "string",
"pattern": "^(?:[1-9]\\d{3}-?(?:(?:0[1-9]|1[0-2])-?(?:0[1-9]|1\\d|2[0-8])|(?:0[13-9]|1[0-2])-?(?:29|30)|(?:0[13578]|1[02])-?31)|(?:[1-9]\\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-?02-?29)T(?:[01]\\d|2[0-3]):?[0-5]\\d:?[0-5]\\d(?:\\.\\d{3})?(?:Z|[+-][01]\\d(?::?[0-5]\\d)?)$"
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"enumCommands": []
}
},
"commands": {
"take": {
"arguments": [
{
"name": "correlationId",
"optional": true,
"schema": {
"title": "String",
"type": "string",
"maxLength": 255
}
},
{
"name": "reason",
"optional": true,
"schema": {
"title": "String",
"type": "string",
"maxLength": 255
}
}
]
}
}
}
For those not familiar with ‘curl’, all it was doing is a bog standard HTTPS GET with an added HTTP header line to add the authorization.