I have an app running on google app engine standard, python 2.7.
GAE already trace calls to the Datastore and to Memcache and I want to add my own traces.
Since I'm in python 2 google-cloud-python is not available for my app.
I made something to overcome that using discovery api client. It kinda work : I can see my traces but they are not linked with GAE traces .
I work on that, checked how I can get the ID of the main span here, the one covering all the request. This information is available in the header X-Cloud-Trace-Context (source).
I found that I do not correctly parse the spanID part of this header.
Know that I do read it correctly and set it as the parent of my own span I got a 400 http error "Invalid parent id!" when I try to push my span.
Here is an example of what GAE already fill automatically in Stackdriver trace that I retrieve from Stackdriver API:
{
"projectId": "my-project",
"traceId": "7043814caa66c00a3fac3555e1d1e9d2",
"spans": [
{
"spanId": "12635947902476947926",
"name": "REDACTED",
"startTime": "2018-09-18T11:44:46.666356Z",
"endTime": "2018-09-18T11:45:02.926300478Z",
"labels": {REDACTED}
},
{
"spanId": "2895282594665317964",
"name": "/remote_socket.CreateSocket",
"startTime": "2018-09-18T11:44:50.469419110Z",
"endTime": "2018-09-18T11:44:50.477561891Z",
"parentSpanId": "12635947902476947926",
"labels": {
"g.co/gae/application_error": "6",
"g.co/gae/error_message": "IP must be wildcard or be an IP returned by this RSG instance on a previous socket() call, received IP: ::1"
}
},
{
"spanId": "12635947904150929113",
"name": "REDACTED",
"startTime": "2018-09-18T11:44:49.588031056Z",
"endTime": "2018-09-18T11:45:02.922000150Z",
"parentSpanId": "12635947902476947926"
},
{
"spanId": "18119035554219197767",
"name": "/cloud_debugger.DebugletStarted",
"startTime": "2018-09-18T11:44:49.605121020Z",
"endTime": "2018-09-18T11:44:49.605863978Z",
"parentSpanId": "12635947902476947926"
},
{
"spanId": "12635947905824910300",
"name": "/remote_socket.CreateSocket",
"startTime": "2018-09-18T11:44:50.468409633Z",
"endTime": "2018-09-18T11:44:50.478480133Z",
"parentSpanId": "12635947904150929113"
},
{
"spanId": "12635947904936909686",
"name": "/urlfetch.Fetch",
"startTime": "2018-09-18T11:44:52.761299204Z",
"endTime": "2018-09-18T11:44:52.766834488Z",
"parentSpanId": "12635947904150929113"
},
{
"spanId": "4533572578254567247",
"name": "/urlfetch.Fetch",
"startTime": "2018-09-18T11:44:52.762846328Z",
"endTime": "2018-09-18T11:44:52.766059416Z",
"parentSpanId": "12635947902476947926",
"labels": {
"/http/method": "GET",
"/http/response/size": "0",
"/http/status_code": "0",
"/http/url": "http://metadata.google.internal",
"/http/host": "metadata.google.internal"
}
},
{
"spanId": "12635947904492451751",
"name": "/user.GetOAuthUser",
"startTime": "2018-09-18T11:45:02.857408315Z",
"endTime": "2018-09-18T11:45:02.862760982Z",
"parentSpanId": "12635947904150929113"
},
{
"spanId": "2960740089906396384",
"name": "/user.GetOAuthUser",
"startTime": "2018-09-18T11:45:02.858548710Z",
"endTime": "2018-09-18T11:45:02.862337765Z",
"parentSpanId": "12635947902476947926"
},
{
"spanId": "12635947905888909837",
"name": "/memcache.Get",
"startTime": "2018-09-18T11:45:02.872708349Z",
"endTime": "2018-09-18T11:45:02.875247917Z",
"parentSpanId": "12635947904150929113"
},
{
"spanId": "2806170211922774912",
"name": "/memcache.Get",
"startTime": "2018-09-18T11:45:02.873653089Z",
"endTime": "2018-09-18T11:45:02.874549693Z",
"parentSpanId": "12635947902476947926",
"labels": {
"g.co/gae/memcache/count": "1",
"g.co/gae/memcache/size": "26680"
}
},
{
"spanId": "12635947905612370518",
"name": "/memcache.Get",
"startTime": "2018-09-18T11:45:02.884082965Z",
"endTime": "2018-09-18T11:45:02.885967828Z",
"parentSpanId": "12635947904150929113"
},
{
"spanId": "1403376319062964670",
"name": "/memcache.Get",
"startTime": "2018-09-18T11:45:02.884984835Z",
"endTime": "2018-09-18T11:45:02.885727464Z",
"parentSpanId": "12635947902476947926",
"labels": {
"g.co/gae/memcache/count": "1",
"g.co/gae/memcache/size": "132"
}
},
{
"spanId": "12635947905900454375",
"name": "/urlfetch.Fetch",
"startTime": "2018-09-18T11:45:02.886823410Z",
"endTime": "2018-09-18T11:45:02.907643995Z",
"parentSpanId": "12635947904150929113"
},
{
"spanId": "12992632058664043952",
"name": "/urlfetch.Fetch",
"startTime": "2018-09-18T11:45:02.887618043Z",
"endTime": "2018-09-18T11:45:02.907269121Z",
"parentSpanId": "12635947902476947926",
"labels": {
"/http/host": "cloudtrace.googleapis.com",
"/http/method": "POST",
"/http/request/size": "590",
"/http/response/size": "165",
"/http/status_code": "400",
"/http/url": "https://cloudtrace.googleapis.com/v2/projects/lumsites-dev/traces:batchWrite?alt=json"
}
},
{
"spanId": "12635947904372387171",
"name": "/logservice.Flush",
"startTime": "2018-09-18T11:45:02.918746300Z",
"endTime": "2018-09-18T11:45:02.920277782Z",
"parentSpanId": "12635947904150929113"
},
{
"spanId": "16196356337812692515",
"name": "/logservice.Flush",
"startTime": "2018-09-18T11:45:02.919606565Z",
"endTime": "2018-09-18T11:45:02.919972451Z",
"parentSpanId": "12635947902476947926"
}
]
}
The header coming from the request : X-Cloud-Trace-Context : 7043814caa66c00a3fac3555e1d1e9d2/12635947902476947926;o=1
So trace ID is 7043814caa66c00a3fac3555e1d1e9d2
and parent span ID is 12635947902476947926 which looks like a 64-bit integer (trace API V1)
Here is the content of body of my request to https://cloudtrace.googleapis.com/v2/projects/my-project/traces:batchWrite?alt=json (Trace api v2) which end in 400
{"spans": [
{
'status': None,
'childSpanCount': 0,
'links': None,
'startTime': '2018-09-18T11: 45: 02.876711Z',
'spanId': '887188cf45b7461b',
'stackTrace': None,
'displayName': {
'truncated_byte_count': 0,
'value': 'manualSpan'
},
'name': 'projects/my-project/traces/7043814caa66c00a3fac3555e1d1e9d2/spans/887188cf45b7461b',
'parentSpanId': '12635947902476947926',
'attributes': {
'attributeMap': {
'g.co/agent': {
'string_value': {
'truncated_byte_count': 0,
'value': 'opencensus-python [
0.1.6
]'
}
}
}
},
'timeEvents': None,
'endTime': '2018-09-18T11: 45: 02.876915Z',
'sameProcessAsParentSpan': None
}
]}
What change between my first working version and this one is the parentSpanId : before, I used a generated spanID. Now I use the one present in the header.
As you can see the parentSpanId I'm using (12635947902476947926) DOES exist in the original trace. It is the parent of all subsequent spans.
The error message is not documented, as far as I could search.
I did not see limitations on parentSpanID like maybe the parentSpanID needs to exists and be present in stackdriver BEFORE we send it.
Maybe I cannot mix incoming spanID in V1 format and sending my spans in V2 format.
The V2 API is expecting parentSpanId to be a 16 character hex string, but you are still sending it as a decimal. Convert it to hex (e.g. af5be7ab4f7b11d6) and the batchWrite call should work.
Related
This is my first attempt at parsing nested JSON with Ruby. I need to go through the JSON to pull out specific values for "_id", "name", and "type" for instance. I then need to create a reference table so that I can refer to each "_id" and associated information. I also need to combine information from multiple JSON responses. I've been able to get basic information and have tried a few things I've found online. I just need a little assistance with a starting point. If anyone has any ideas of where to start with this I'd really appreciate it.
Devices JSON response hash. Each device starts with _id.
{
"api": "1.0",
"error": null,
"id": "60b5d4c3077862123cfa4443",
"result": {
"devices": [
{
"_id": "123456787786211fd31f3dd",
"batteryPowered": true,
"category": "door_lock",
"deviceTypeId": "144_1_1",
"firmware": [
{
"id": "us.144.1_1.0",
"version": "2.6"
}
],
"gatewayId": "1234567807786214fbc6bd4e",
"info": {
"firmware.stack": "3.28",
"hardware": "0",
"manufacturer": "Kwikset",
"model": "912",
"protocol": "zwave",
"zwave.node": "2",
"zwave.smartstart": "no"
},
"name": "Garage Door",
"parentDeviceId": "",
"persistent": false,
"reachable": false,
"ready": true,
"roomId": "1234567807786211fd31f3eb",
"security": "middle",
"status": "idle",
"subcategory": "",
"type": "doorlock"
},
{
"_id": "1234567897786211fd31f3ed",
"batteryPowered": true,
"category": "door_lock",
"deviceTypeId": "59_1_1129",
"firmware": [
{
"id": "us.59.18064.0",
"version": "3.3"
},
{
"id": "us.59.18065.1",
"version": "11.0"
}
],
"gatewayId": "1234567897786214fbc6bd4e",
"info": {
"firmware.stack": "6.3",
"hardware": "3",
"manufacturer": "Schlage",
"model": "BE469ZP",
"protocol": "zwave",
"zwave.node": "3",
"zwave.smartstart": "no"
},
"name": "Front Door",
"parentDeviceId": "",
"persistent": false,
"reachable": true,
"ready": true,
"roomId": "1234567807786211fd31f3ec",
"security": "high",
"status": "idle",
"subcategory": "",
"type": "doorlock"
},
{
"_id": "1234567897786211fd31f40a",
"batteryPowered": false,
"category": "switch",
"deviceTypeId": "57_20562_12344",
"firmware": [
{
"id": "us.57.29240.0",
"version": "5.25"
}
],
"gatewayId": "1234567807786214fbc6bd4e",
"info": {
"firmware.stack": "4.54",
"hardware": "255",
"manufacturer": "Honeywell",
"model": "ZW4103/39337",
"protocol": "zwave",
"zwave.node": "4",
"zwave.smartstart": "no"
},
"name": "Lamp Switch",
"parentDeviceId": "",
"persistent": false,
"reachable": true,
"ready": true,
"roomId": "1234567807786211fd31f416",
"security": "no",
"status": "idle",
"subcategory": "interior_plugin",
"type": "switch.outlet"
},
{
"_id": "1234567b07786211fd31f40e",
"batteryPowered": false,
"category": "dimmable_light",
"deviceTypeId": "57_20548_12339",
"firmware": [
{
"id": "us.57.29747.0",
"version": "5.21"
}
],
"gatewayId": "1234567d07786214fbc6bd4e",
"info": {
"firmware.stack": "4.34",
"hardware": "255",
"manufacturer": "Honeywell",
"model": "39339/ZW3107",
"protocol": "zwave",
"zwave.node": "5",
"zwave.smartstart": "no"
},
"name": "Lamp Dimmer",
"parentDeviceId": "",
"persistent": false,
"reachable": true,
"ready": true,
"roomId": "1234567807786211fd31f416",
"security": "no",
"status": "idle",
"subcategory": "dimmable_plugged",
"type": "dimmer.outlet"
}
]
}
}
There is then also a JSON response that lists the functions for each device in the same format above. However instead of "devices"=> it is "items"=> and the beach function is the _id key again.
I'd like to combine function _id tags and descriptions with the device JSON, so I can create a way to send my script "unlock door lock 1" and it subs the number with the _id of the device and the function _id.
You can start with a very rough navigator function like this:
def find_device(data, name, index)
# Filter through the device list...
data['result']['devices'].select do |device|
# ...for matching names.
device.name == name
end[index] # Take indexed entry
end
Where now you can do find_device(data, 'door_lock', 0) to dig up that entry.
Converting "door lock 1" to [ 'door_lock', 0 ] should be pretty trivial:
def to_location(str)
# Split off the name component(s) and index number
*name, index = str.split(/\s+/)
# Reassemble with underscores and -1 to account for 0-index
[ name.join('_'), index.to_i - 1 ]
end
I have a webhook from my google assistant new actions builder platform. Webhook code is written in the dotnet vs2019. I have followed the webhook request and response format and sample jsons provided in the below links.
https://developers.google.com/assistant/conversational/reference/rest/v1/TopLevel/fulfill#User
https://developers.google.com/assistant/conversational/webhooks#request-json_1
But when I test assistant action, it is failing. Below is request and response json from logs in the google assistant test simulator.Error message just says"Invalid response from webhook: Failed to translate JSON to ExecuteHttpResponse." I don't know why it is not valid. Can someone help me resolving this.
{
"requestJson": {
"handler": {
"name": "agentcube"
},
"intent": {
"name": "",
"params": {
"phone": {
"original": "1234562869",
"resolved": 1234562869
}
},
"query": "1234562869"
},
"scene": {
"name": "Start",
"slotFillingStatus": "FINAL",
"slots": {
"Zip": {
"mode": "REQUIRED",
"status": "SLOT_UNSPECIFIED",
"updated": false,
"value": 37122
},
"Phone": {
"mode": "REQUIRED",
"status": "SLOT_UNSPECIFIED",
"updated": true,
"value": 1234562869
},
"FName": {
"mode": "REQUIRED",
"status": "SLOT_UNSPECIFIED",
"updated": false,
"value": "john doe"
}
},
"next": {
"name": "actions.scene.END_CONVERSATION"
}
},
"session": {
"id": "ABwppHFkFuGBF-UawPmIkxWpkfM1Hb5An7h8KnjR302zukmBoKA1NqDp7DfePGzYsyxT5oy--wg5Jkjj",
"params": {
"Phone": 1234562869,
"FName": "john doe",
"Zip": 37122
},
"typeOverrides": [],
"languageCode": ""
},
"user": {
"locale": "en-US",
"params": {},
"accountLinkingStatus": "NOT_LINKED",
"verificationStatus": "VERIFIED",
"packageEntitlements": [],
"gaiamint": "",
"permissions": [],
"lastSeenTime": "2021-01-28T19:21:28Z"
},
"home": {
"params": {}
},
"device": {
"capabilities": [
"SPEECH",
"RICH_RESPONSE",
"LONG_FORM_AUDIO"
]
}
}
}
Invalid response from webhook: Failed to translate JSON to ExecuteHttpResponse..
{
"responseJson": {
"Session": {
"Id": "ABwppHFkFuGBF-UawPmIkxWpkfM1Hb5An7h8KnjR302zukmBoKA1NqDp7DfePGzYsyxT5oy--wg5Jkjj",
"Params": {
"Phone": 1234562869,
"Zip": 37122,
"FName": "john doe"
}
},
"Prompt": {
"Override": false,
"FirstSimple": {
"Speech": "My webhook response",
"Text": "My response from webhook"
}
},
"Scene": {
"Name": "Start",
"SlotFillingStatus": "FINAL",
"Slots": {
"Phone": {
"Mode": "REQUIRED",
"Status": "SLOT_UNSPECIFIED",
"Updated": true,
"value": 1234562869
},
"FName": {
"Mode": "REQUIRED",
"Status": "SLOT_UNSPECIFIED",
"Updated": false,
"value": "john doe"
},
"Zip": {
"Mode": "REQUIRED",
"Status": "SLOT_UNSPECIFIED",
"Updated": false,
"value": 37122
}
},
"Next": {
"Name": "actions.scene.END_CONVERSATION"
}
}
}
}
Make sure the response that you code is returning is json by checking with a linter, which this seems to checks (i.e. everything inside the ResponseJson {}
Please see my response to a similar issue at https://stackoverflow.com/a/66512370/10537202 to use the webhook playground.
I am trying to get dynamic data from the slot
As per documentation and my basic test I am sending directive from launch request as like :
{'version': '1.0', 'response': {'outputSpeech': {'type': 'SSML', 'ssml': '<speak> Hi, welcome to developement dynamic slot. <break time="800ms"/>Please tell me the product name you would be interested in</speak>'}, 'card': {'type': 'Simple', 'title': 'Choose a Medicine.', 'content': 'Pick a Medicine.'}, 'reprompt': {'outputSpeech': {'type': 'SSML', 'ssml': '<speak><break time="5s"/>I am HERE to help You, Please tell me the product and country names you would be interested in.</speak>'}}, 'shouldEndSession': False}, 'directives': [{'type': 'Dialog.UpdateDynamicEntities', 'updateBehavior': 'REPLACE', 'types': [{'name': 'products', 'values': [{'id': 'grnTea', 'name': {'value': 'green tea', 'synonyms': ['matcha']}}, {'id': 'oolTea', 'name': {'value': 'oolong', 'synonyms': ['chinese tea', 'black dragon tea']}}]}]}]}
and when I'm trying to get data which is not statically store in a slot but added in directive slot value.
returns following output :
{ "version": "1.0", "session": { "new": false, "sessionId": "amzn1.echo-api.session.671181ed-1e50-4e4c-b70e-4d854fe7cb78", "application": { "applicationId": "amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb" }, "user": { "userId": "amzn1.ask.account.sadasdsa", "permissions": { "consentToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ..XyWgyUIjDzzlZ12CR0lbZid6GxwZZYBgarlV-9difbkFjOTxrcvS9lJYWo-Db3wo-fIdXb_jZkCAJBtYPggqnJhLyyC-EDa0_u9aARKthF1_nkbLh5zDOHDb8MyyOYro4BJlqm4XBNd1qyeQUV2M4fdca1YSEnbEun_6kWOKeFRS-14zcwMj5E-MHcBbeDX799A_kay82kS8VGeMhSUsXPTZFrwOKHcFweJTqXFNOkBxME8kAFfS1JB5MNbA3TujVIsIgTBSNQaJeHRksConKt0u06ATrjffzFkcmbxDT5HoJH4NqDgS0y_GdtaeXQM3LJ-MN0-_DMX2QVEaL6kUUw" } } }, "context": { "System": { "application": { "applicationId": "amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb" }, "user": { "userId": "amzn1.ask.account.aasdasdasdasdas", "permissions": { "consentToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.asdjaskdhas.XyWgyUIjDzzlZ12CR0lbZid6GxwZZYBgarlV-9difbkFjOTxrcvS9lJYWo-Db3wo-fIdXb_jZkCAJBtYPggqnJhLyyC-EDa0_u9aARKthF1_nkbLh5zDOHDb8MyyOYro4BJlqm4XBNd1qyeQUV2M4fdca1YSEnbEun_6kWOKeFRS-14zcwMj5E-MHcBbeDX799A_kay82kS8VGeMhSUsXPTZFrwOKHcFweJTqXFNOkBxME8kAFfS1JB5MNbA3TujVIsIgTBSNQaJeHRksConKt0u06ATrjffzFkcmbxDT5HoJH4NqDgS0y_GdtaeXQM3LJ-MN0-_DMX2QVEaL6kUUw" } }, "device": { "deviceId": "amzn1.ask.device.ajshdjkhasjkhdkjsahkasdhjasd", "supportedInterfaces": {} }, "apiEndpoint": "https://api.eu.amazonalexa.com", "apiAccessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.asdhjashjdhajsd.RQhzWmnhN9K_dCbsFXBPPoLVzuwe5BWjAruwJNF1pVr11PiygVgQ64W3CNng2sK1thT2tl6r3GuRtG-1133Aw1KPWtMuHElu7CTrFfgAqW8blpK37PJIvPMOUGBw1rbrgCTMdy8Ua7qSFV_Y_wlOJaV3-apDGBqhQKE_-dE-ntWYZuIySlY3l8hBs_66eELS-LiL5DEDJk1hfvC2C6ZFB7A7P8mx4Hb71km-lYaElJS0-FDP0C-LdSp6dCbzV23W4JehtTGL4kJ1JEQgWyuNAAkt_HmPcEYlPp8T5RFceDuVuz-ZZBFyiVKuAN8VmxyFsmnC3SXi4yb3RKm1SCcorg" }, "Viewport": { "experiences": [ { "arcMinuteWidth": 246, "arcMinuteHeight": 144, "canRotate": false, "canResize": false } ], "shape": "RECTANGLE", "pixelWidth": 1024, "pixelHeight": 600, "dpi": 160, "currentPixelWidth": 1024, "currentPixelHeight": 600, "touch": [ "SINGLE" ], "video": { "codecs": [ "H_264_42", "H_264_41" ] } }, "Viewports": [ { "type": "APL", "id": "main", "shape": "RECTANGLE", "dpi": 160, "presentationType": "STANDARD", "canRotate": false, "configuration": { "current": { "video": { "codecs": [ "H_264_42", "H_264_41" ] }, "size": { "type": "DISCRETE", "pixelWidth": 1024, "pixelHeight": 600 } } } } ] }, "request": { "type": "IntentRequest", "requestId": "amzn1.echo-api.request.0f3b51f1-880b-483f-8410-3210e81e5b59", "timestamp": "2020-01-01T11:48:09Z", "locale": "en-IN", "intent": { "name": "productcheck", "confirmationStatus": "NONE", "slots": { "products": { "name": "products", "value": "green tea", "resolutions": { "resolutionsPerAuthority": [ { "authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.c35cd12c-6845-473e-be58-9b1139ee0adb.products", "status": { "code": "ER_SUCCESS_NO_MATCH" } } ] }, "confirmationStatus": "NONE", "source": "USER" } } } } }
It's not added resolutions resolutionsPerAuthority's second(dynamic) element in the list.
anybody can help me out from this problem?
I tested your added directive exactly as pasted and the dynamic entity resolved as expected:
"slots": {
"products": {
"name": "products",
"value": "matcha",
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.****.products",
"status": {
"code": "ER_SUCCESS_NO_MATCH"
}
},
{
"authority": "amzn1.er-authority.echo-sdk.dynamic.amzn1.ask.skill.****.products",
"status": {
"code": "ER_SUCCESS_MATCH"
},
"values": [
{
"value": {
"name": "green tea",
"id": "grnTea"
}
}
]
}
]
},
"confirmationStatus": "NONE",
"source": "USER"
}
}
Could you share your skill's interaction model to investigate further?
My issue is basically described in title but I'll add a little bit more details here.
I'm trying to proactively send an update report to Alexa's Event Hub for Smart Home skills, however this fails with a 400 Bad Request error, and this is what the server responds:
{
"header": {
"namespace": "System",
"name": "Exception",
"messageId": "a154410c-2364-4c5b-9028-accde5048e1e"
},
"payload": {
"code": "INVALID_REQUEST_EXCEPTION",
"description": "Event or endpoint is missing in the request."
}
}
I decided then to check if my request was wrong by sending the one that can be found on their documentation, and I'm getting the very same error.
This is the JSON copied from Amazon's documentation (I just replaced device metadata and the token):
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "AddOrUpdateReport",
"payloadVersion": "3",
"messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4"
},
"payload": {
"endpoints": [
{
"endpointId": "<unique ID of the endpoint>",
"manufacturerName": "Sample Manufacturer",
"description": "Smart Light by Sample Manufacturer",
"friendlyName": "Kitchen Light",
"additionalAttributes": {
"manufacturer" : "Sample Manufacturer",
"model" : "Sample Model",
"serialNumber": "<the serial number of the device>",
"firmwareVersion" : "<the firmware version of the device>",
"softwareVersion": "<the software version of the device>",
"customIdentifier": "<your custom identifier for the device>"
},
"displayCategories": [
"LIGHT"
],
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true,
"retrievable": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.BrightnessController",
"version": "3",
"properties": {
"supported": [
{
"name": "brightness"
}
],
"proactivelyReported": true,
"retrievable": true
}
}
],
"connections": [
],
"cookie": {
}
}
],
"scope": {
"type": "BearerToken",
"token": "access-token-from-Amazon"
}
}
}
}
What I don't understand is why it reports that event or endpoints are missing if they're clearly there and if this JSON is the one that they provide in their documentation.
Does anyone have this issue too?
EDIT: pasting my payload as requested.
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "AddOrUpdateReport",
"payloadVersion": "3",
"messageId": "132137185729061389"
},
"payload": {
"endpoints": [
{
"endpointId": "Rmxvb2RTZW5zb3JfMDE=",
"friendlyName": "Flood sensor",
"description": "Flood sensor",
"manufacturerName": "MyCompany",
"displayCategories": [
"ACTIVITY_TRIGGER"
],
"cookie": {
"DeviceType": "FloodSensor"
},
"capabilities": [{
"interface": "Alexa",
"type": "AlexaInterface",
"version": "3"
},
{
"interface": "Alexa.EndpointHealth",
"type": "AlexaInterface",
"version": "3",
"properties": {
"supported": [{
"name": "connectivity"
}],
"proactivelyReported": true,
"retrievable": true
}
}
]
}
],
"scope": {
"type": "BearerToken",
"token": "<redacted>"
}
}
}
}
I'm trying to develop microservices on cumulocity.
I'm following this https://cumulocity.com/guides/microservice-sdk/java/.
I'm able to create the application having this response
"availability": "MARKET",
"id": "23",
"key": "TESTMICRO-microservice-key",
"manifest": {
"imports": [],
"noAppSwitcher": true
},
"name": "TESTMICRO",
"owner": {
"self": "my_tenant/tenant/tenants/management",
"tenant": {
"id": "management"
}
},
"requiredRoles": [
"ROLE_INVENTORY_READ"
],
"roles": [
"ROLE_CUSTOM_MICROSERVICE"
],
"self": "my_tenant/application/applications/23",
"type": "MICROSERVICE"
}
Nevertheless when I try the GET URL/application/applications/23/bootstrapUser it returns me 404 Error.
Anyone that can help me?
You probably need to subscribe the application to the tenant:
POST {{url}}/tenant/tenants/{{tenant}}/applications
Body
{
"application": {
"id": "{APPLICATION_ID}"
}
}