I'm triying to multiple language text detection with google cloud vision. But I have a problem.
If I send the request text detection api endpoint this url;
https://vision.googleapis.com/v1/images:annotate?key=XxxXX
and this body;
{
"requests": [
{
"image": {
"source": {
"imageUri": "image_url"
}
},
"features": [
{
"type": "DOCUMENT_TEXT_DETECTION",
"maxResults": 1
}
],
"ImageContext": {
"languageHints": [
"tr", "en"
]
}
}
]
}
I'm getting the this error code;
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"image_context\" at 'requests[0]': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "requests[0]",
"description": "Invalid JSON payload received. Unknown name \"image_context\" at 'requests[0]': Cannot find field."
}
]
}
]
}
}
What is a problem?
The problem is the field "ImageContext", it should be "imageContext" with lower-case "i".
Related
I'm converting Apple records data (in DSTU2 format) to R4 format.
This is the data I'm sending to healthlake server
{
"category": [
{
"text": "Vital Signs",
"coding": [
{
"system": "http://hl7.org/fhir/observation-category",
"code": "vital-signs"
}
]
}
],
"issued": "2017-03-18T00:00:00Z",
"status": "final",
"id": "49a1b0f9-34c2-472d-8b64-34447d307c56",
"code": {
"text": "Temperature",
"coding": [{ "system": "http://loinc.org", "code": "8310-5" }]
},
"encounter": { "reference": "Encounter/355" },
"subject": { "reference": "Patient/82146c45-a7cd-47ee-a5ba-8c588d4c5c9e" },
"valueQuantity": {
"code": "Cel",
"system": "http://unitsofmeasure.org",
"value": 37.6,
"unit": "Cel"
},
"resourceType": "Observation",
"meta": { "lastUpdated": "2023-01-30T09:17:54.772Z" }
}
But the healthlake server is giving me the following error
{"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"processing","diagnostics":"This property must be an Array, not an array","location":["Observation.category[0]"]}]}
What does this error means and how to fix this?
PS: I'd only googled the error and could not get any leads
enter image description here
Here this is my custom template which I have created. Using this template am
trying to send what's app msg but i got 132000 error
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "917760569250",
"type": "template",
"template": {
"name": "media_messages",
"language": {
"code": "en_US"
},
"components": [
{
"type":"header",
"parameters":[
{
"type":"document",
"document":{
"id": "1195808994372455"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Document"
}
]
}
]
}
}
We have had everything working perfectly for the last couple of years, then all of a sudden in the last week we cant log into AWS using the Google SSO.
We are setting up the roles for the users again (as per https://aws.amazon.com/blogs/security/how-to-set-up-federated-single-sign-on-to-aws-using-google-apps/), but when we get to the users.patch (or users.update) section with the following call (values for <role ARN>,<provider ARN> replaced with actual...):
"customSchemas": {
"SSO": {
"role": [
{
"value": "<role ARN>,<provider ARN>",
"customType": "iPDA-sysadmin"
}
]
}
}
}
We get the following error:
{
"error": {
"code": 400,
"message": "Invalid Input: Bad request for ",
"errors": [
{
"message": "Invalid Input: Bad request for ",
"domain": "global",
"reason": "invalid"
}
]
}
}
Any ideas would be great...
https://support.google.com/a/answer/6327792?hl=en
You need to pass in the type as well.
{
"customSchemas":
{
"SSO":
{
"role": [
{
"value": "<role ARN>,<provider ARN>",
"type": "custom"
"customType": "SSO"
}
]
}
}
}
I am currently developing a smart home skill for my blinds, however I am unable to discover device. Is there a way for me to validate my Discovery response message? I'm thinking this is some logical error in the JSON.
I'm using a Lambda function to perform the requests to my API using node-fetch and async/await, thus I have tagged all JS function as async, this could be another potential cause of this issue. I don't get any errors in CloudWatch either.
This is the response my Lambda function is sending:
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"payloadVersion": "3",
"messageId": "0a58ace0-e6ab-47de-b6af-b600b5ab8a7a"
},
"payload": {
"endpoints": [
{
"endpointId": "com-tobisoft-rollos-1",
"manufacturerName": "tobisoft",
"description": "Office Blinds",
"friendlyName": "Office Blinds",
"displayCategories": [
"INTERIOR_BLIND"
],
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.RangeController",
"instance": "Blind.Lift",
"version": "3",
"properties": {
"supported": [
{
"name": "rangeValue"
}
],
"proactivelyReported": true,
"retrievable": true
},
"capabilityResources": {
"friendlyNames": [
{
"#type": "asset",
"value": {
"assetId": "Alexa.Setting.Opening"
}
}
]
},
"configuration": {
"supportedRange": {
"minimumValue": 0,
"maximumValue": 100,
"precision": 1
},
"unitOfMeasure": "Alexa.Unit.Percent"
},
"semantics": {
"actionMappings": [
{
"#type": "ActionsToDirective",
"actions": [
"Alexa.Actions.Close"
],
"directive": {
"name": "SetRangeValue",
"payload": {
"rangeValue": 100
}
}
},
{
"#type": "ActionsToDirective",
"actions": [
"Alexa.Actions.Open"
],
"directive": {
"name": "SetRangeValue",
"payload": {
"rangeValue": 1
}
}
},
{
"#type": "ActionsToDirective",
"actions": [
"Alexa.Actions.Lower"
],
"directive": {
"name": "AdjustRangeValue",
"payload": {
"rangeValueDelta": 10,
"rangeValueDeltaDefault": false
}
}
},
{
"#type": "ActionsToDirective",
"actions": [
"Alexa.Actions.Raise"
],
"directive": {
"name": "AdjustRangeValue",
"payload": {
"rangeValueDelta": -10,
"rangeValueDeltaDefault": false
}
}
}
],
"stateMappings": [
{
"#type": "StatesToValue",
"states": [
"Alexa.States.Closed"
],
"value": 100
},
{
"#type": "StatesToRange",
"states": [
"Alexa.States.Open"
],
"range": {
"value": 0
}
}
]
}
},
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
}
]
}
]
}
}
}
Thanks for any help.
Is there a way for me to validate my Discovery response message?
Yes, you could use the Alexa Smart Home Message JSON Schema. This schema can be used for message validation during skill development, it validates Smart Home skills (except the Video Skills API).
This is the response my Lambda function is sending
I've validated your response following this steps, the result: no errors found, the JSON validates against the schema. So, there's probably another thing going on. I suggest getting in touch with Alexa Developer Contact Us
I need to get friends' albums with photos. Do that with batch query (coz https://developers.facebook.com/docs/reference/fql/).
[
{ "method":"GET",
"name":"get-friends",
"relative_url":"me/friends?fields=id,name",
"omit_response_on_success": false
},
{
"method":"GET",
"name":"get-albums",
"relative_url":"{result=get-friends:$.data.*.id}/albums",
"omit_response_on_success": false
},
{
"method":"GET",
"name":"get-photos",
"relative_url":"{result=get-albums:$.data.*.id}/photos"
}
]
But in response i got error.This is response:
[
{
"code": 200,
"body": "{
"data": [
{
"id": "xxxx",
"name": "Name Lastname"
},{
"id": "xxxx",
"name": "Name2 Lastname"
}
],
"paging": {
"next": "https://graph.facebook.com/v2.4/xxx/friends?fields=id,name&format=json&access_token=xxx&limit=25&offset=25&__after_id=enc_xxx"
},
"summary": {
"total_count": 4
}
}"
},
{
"code": 200,
"body": "{
"data": [
{
"name": "1 Photos",
"created_time": "2012-11-22T04:22:46+0000",
"id": "xxx"
},
{
"name": "2 Pictures",
"created_time": "2010-09-12T02:48:42+0000",
"id": "xxx"
},
{
"name": "3 Personal",
"created_time": "2007-10-25T15:59:06+0000",
"id": "xxx"
}
],
"paging": {
"cursors": {
"after": "NTc0NyQxMzkwOQ==",
"before": "MTAxNTuyNjIzMzQwMDg5MTA="
}
}
}"
},
{
"code": 404,
"body": "{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: xxx,xxx,xxx",
"type": "OAuthException",
"code": 803
}
}"
}
]
Please tell me where is my mistake or tell me another way.
You canĀ“t get access to albums of friends, all friend permissions have been removed with v2.0 of the Graph API: https://developers.facebook.com/docs/apps/changelog#v2_0
You can only get access to albums of users who authorized your App (with user_photos, of course).