jsonPath and email address - jsonpath

I am using jsonpath.com to try to use an email address as the KEY.
so my data might look like this:
"phoneNumbers": [
{
"type" : "iPhone",
"bob#gmail.com": 123456,
"number": "0123-4567-8888"
},
however, i am unable to reference the email address:
$.phoneNumbers[0]['type'] // iPhone
$.phoneNumbers[0]['number'] // 0123-4567-8888
$.phoneNumbers[0]['bob#gmail.com'] // no match
$.phoneNumbers[0]['bob\#gmail.com'] // no match
$.phoneNumbers[0]['bob\#gmail\.com'] // no match
how may i specify a jsonPath key using an email address?

The dot in .com is the problem. See this SO answer. It would seem that it should be possible to do $.phoneNumbers[0]['bob#gmail.com'], but not on jsonpath.com
The key statement in that answer:
jsonpath.com is based on an outdated version of JSONPath and is not
reliable for previewing what current libraries would provide you with.

Related

Not able to connect cosmo table api using datafactory

Keys are stored in secret as "cosmostablekey" for cosmos table api.
Created another secret stored in key valuets as below.
{
"name": "CosmosDbSQLAPILinkedService",
"properties": {
"type": "CosmosDb",
"typeProperties": {
"connectionString": "AccountEndpoint=https://XXXXXXX.table.cosmos.azure.com:443/;Database=TablesDB",
"accountKey": { 
"type": "AzureKeyVaultSecret", 
"store": { 
"referenceName": "ls_cosmos_key"", 
"type": "LinkedServiceReference" 
}, 
"secretName": "cosmostablekey" 
}
},
"connectVia": {
"referenceName": "AutoResolveIntegrationRuntime",
"type": "IntegrationRuntimeReference"
}
}
}
when try to create linked service used authentication type as key authentication in adf and tried for test connection got below error.
Error code
9082
Details
The CosmosDb key is in a wrong format.
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
Activity ID: f0c9c682-12de-4b53-95e9-7abe7ea722b7.
am sure copied key strig properly to key vaults.
Used for refence to connect cosmos db from adf.
microsoftdoctoconnectcosmosDB
Thanks for quick help.
Issue is got resolved
Need to call only cosmostablekey key in linked services for key athentication. More over need to specify endpoint as
https://XXXX.documents.azure.com:443/
instead of https://XXXX.table.azure.com:443/
Working fine for me now..

Google Admin SDK - Users: Patch - Issue using Strings

i have an issue using the Users: Patch - API.
I try to patch the name of the primary organization of a user using the following Request Body:
{
"organizations":[
{
"name":"Org. Name",
"primary":true,
"type":work
}
]
}
The values of the users entry get patched, but the result looks like:
{
"organizations":[
{
"name": "\"Org. Name\"",
"primary": true,
"type": "work"
}
]
}
The problem: the VCard entry of the user shows "Org. Name" instead of Org. Name as it should.
Is it possible to prevent the string getting formatted as a string again by the API?
Thank you for your help!
Lukas

Get unique device id for amazon echo

I am writing a custom skill for the amazon echo and I need to get a unique device id so I can register then product to my service. Everything I read says that you cannot get the id from the device. Has amazon changed this? Is there a work around to get a device id?
This week Amazon added the Device ID (unique) to the LaunchRequest JSON payload in Alexa Skills.
{
"session": {
"new": true,
"sessionId": "string",
"application": {
"applicationId": "string"
},
},
"context": {
"device": {
"deviceId": "string",
},
"request": {}
}
You can use the context->device->deviceId string to uniquely identify the device from which the request came.
Read more # https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#request-body-syntax
There is no way to get a unique device ID. All you can do is get a unique User ID. There is no known workaround.
If you're looking for how to get Alexa Device ID?
Use the below snippet, It will work like a charm.
device_id = handler_input.request_envelope.context.system.device.device_id
I hope this helps you.

GA Management API, Insert filter: lowercaseDetails.field not valid?

I am working on a web tool to insert filter through management API.
When creating lowercase function, I used strings such as 'Hostname' or 'hostname' in lowercaseDetials.field, but I get an 400 error and the detail is 'lowercaseDetails.field is required'. Seems that whatever I passed on was not in the correct format?
Anyone has an idea how I should specify this 'field'? I imagined it should just be the string in the option list in GA? I can't see anything in google developer docs
var request = gapi.client.analytics.management.filters.insert(
{
'accountId': accountId,
'resource': {
'name': filterName,
'type': 'LOWERCASE',
'lowercaseDetails': {
'field': "Hostname"
}
}
});
Any help will be very much appreciated!
It turned out it should be all capitalized, also, a space should be replaced with an underscore.

LinkedinAPI: Get Phone Number from 1st Connection?

I've tried
https://api.linkedin.com/v1/people/~/connections:(id,first-name,last-name,phone-numbers)
but it's only get (id,first-name,last-name)
even this:
http://api.linkedin.com/v1/people/id=UserId:(phone-numbers)
Does LinkedIn expose this field ? I've google it, but not found somewhere ..
Linkedin Not provide phone numbers of connections. They only provide basic profile of connections.
check here https://developer.linkedin.com/documents/connections-api
LinkedIn will provide the phone number if the user authorizes r_contactinfo
Sample Request URL:
https://api.linkedin.com/v1/people/~:(id,phone-numbers)?format=json
Sample JSON Response:
{
"id": "ye3i9-_24l",
"phoneNumbers": {
"_total": 1,
"values": [
{
"phoneNumber": "89xx189198",
"phoneType": "mobile"
}
]
}
}
LinkedIn not provide phone number. Check this document for accessible fields of profile
Basic Profile Fields

Resources