query data in a airtable database using url - database

I want to implement URL for search specific data in my base using filterByFormula
below are my link and I got an error and how to resolve that
my url:
api.airtable.com/v0/APPID/Stories?filterByFormula=(FIND(“Car (in robot form) will offer a hug when I am stressed out”,{User want}) &api_key=MYKEY
Error :
{
"error": {
"type": "INVALID_FILTER_BY_FORMULA",
"message": "The formula for filtering records is invalid: Invalid formula. Please check your formula text."
}
}
I tried using postman, please help me.

While querying filtered data from Airtable via API, you don't have to use FIND keyword. You can filter data with simple Airtable formula like structure. For example,
{Email} = 'johnwick#neverdie.com'
Above filter retrieve all the records from the table whose Email is simply johnwick#neverdie.com
To limit number of records retrieve by API maxRecord parameter is available for that. For more info about various parameters please refer my answer here AirTable API Find record by email or official Airtable API Documentation
In your case
API url would be structured like,
api.airtable.com/v0/APPID/Stories?filterByFormula=Car+(in+robot+form)+will+offer+a+hug+when+I+am+stressed+out%3D%22User+want%22&api_key=MYKEY
For more info about Airtable API encoding, check this https://codepen.io/airtable/full/rLKkYB?baseId=app1C5TVoophmmr8M&tableId=tblvILr4aSAYI98oa
Hope this helps!

Related

Selling Partner API Feeds API

I am using the Feeds API to update inventory using the this link. I am able to perform the Step 1 :- Create a feed document response is
{
"payload":{"encryptionDetails":
{
"standard":"AES","initializationVector":"vHLW3sNN41sEQp1e9wjNSg==",
"key":"oQvgdrwiBbBO3SLf4p81zQuIgROkTDA9Yikv6DvMIcg="
},
"feedDocumentId":"amzn1.tortuga.3.11ef10ee-e839-4a0b-b7a4-dcfbe78900ae.T1OWK0QMT4NDF7",
"url":"https://tortuga-prod-eu.s3-eu-west-1.amazonaws.com/%2FNinetyDays/amzn1.tortuga.3.11ef10ee-e839-4a0b-b7a4-dcfbe78900ae.T1OWK0QMT4NDF7?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210117T190852Z&X-Amz-SignedHeaders=&X-Amz-Expires=300&X-Amz-Credential=&X-Amz-Signature="
}
}
At Step 2 Encrypt and upload the feed data Response :-
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.XXXXXXXXXXXXXXXXXXXXAWS4-HMAC-SHA256 20210117T190852Z 20210117/eu-west-1/s3/aws4_request 6efdf3105b88a49723fed6068792a6f1a5858196f957e3a52f76e4cee2ccb07e9197ea9212ce444f640080a3df1d628de0bc26d9a0cafea9577fd23d2c1b3fc6 BYTESPUT //NinetyDays/amzn1.tortuga.3.11ef10ee-e839-4a0b-b7a4-dcfbe78900ae.T1OWK0QMT4NDF7 X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=CREDENTIAL&X-Amz-Date=20210117T190852Z&X-Amz-Expires=300&X-Amz-SignedHeaders=content-type%3Bhost content-type:application/json host:tortuga-prod-eu.s3-eu-west-1.amazonaws.com content-type;host UNSIGNED-PAYLOADBYTESEA417EC74F012746CpSqzu64eIWZv0Y7JWoylN5rrCAJzort9+7EGhH0KqaSHknlV+ZYuX76zqv2shr+yFDksDntFNI=
Anybody facing the same problem or any ideas where the problem is

Ability to filter users with onPremisesSamAccountName with Microsoft Graph API

I would like to filter Users from Microsoft Graph API based on onPremisesSamAccountName, which is currently not available with Graph API.
We have the internal employee id to be stored with onPremisesSamAccountName variable which is present in users API of Microsoft Graph. We are trying to filter with onPremisesSamAccountName property to filter based on the internal employee id. Currently, we are not able to do that with Graph API but we really need this to be working or would be happy if we get to know any possible workarounds.
https://graph.microsoft.com/v1.0/users?$filter=onPremisesSamAccountName eq '[some-id]'&$select= userPrincipalName,displayName,department,jobTitle,companyName,onPremisesSamAccountName,....[more list of fields for select]
The expected outcome is to show the required result but the response what we got is as follows:
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Unsupported or invalid query filter clause specified for property 'onPremisesSamAccountName' of resource 'User'.",
"innerError": {
"request-id": "[request-id from request]",
"date": "[date on which request is made]"
}
}
}
As you can see, the filter is not supported for property 'onPremisesSamAccountName'.
If you do have this requirement, you can post your idea at Microsoft Graph UserVoice.
I was able to do a filter using onPremisesUserPrincipalName - you could check what is returned using this property and see if you can make it work

Parameter subscription must conform to pattern ^projects/[^/]+subscriptions/[^/]+$

.I am trying to create a data fusion pipeline which fetches data from pub sub and the used projection to convert message into string (as told by you) and thens ave it to GCS.
howeer,its giving me error: Parameter subscription must conform to pattern ^projects/[^/]+subscriptions/[^/]+$
I am using correct topic and subsctiption name projects/test/subscriptions/dataFusionSubscribe projects/test/topics/DataFusionTopic
You don't need to include the full subscription and topic name in the config, you only need to provide project id as test, subscription id as dataFusionSubscribe, and topic as DataFusionTopic
Attached is a screenshot showing the config for the Pubsub

Microsoft Graph API - Get directory objects from a list of ids - Bad request

I need to get a list of groups that the user is a member of using Microsoft Graph API.
For this, I am using the endpoint POST /users/<userId>/getMemberGroups (doc). This works fine but the problem is that the response is only a list of group object ids. I need to get group properties too. I could just loop through the list and query API for GET /groups/<groupId> but this takes too long when the user has multiple groups.
Then I found POST /directoryObjects/getById (doc) which turns that list into what I need. I have followed the doc page exactly but I am getting the following error:
Request_BadRequest - Specified HTTP method is not allowed for the request target. (HTTP status 405)
What am I doing wrong? Is the method getById bugged? If it is, is there any alternative way to turn a list of group object ids into groups or to get full list of user groups?
The API Get directory objects from a list of ids you mentioned should work, I test it in the MS Graph Explorer, it works fine.
Make sure you use POST method, I can reproduce your issue with another method.
You could refer to the informations below and try again.
Request URL:
POST https://graph.microsoft.com/beta/directoryObjects/getByIds
Request Body:
{
"ids": [
"xxxxxxxx-9f1b-4f28-a408-xxxxxxxxxxxx",
"xxxxxxxx-a614-4335-81eb-xxxxxxxxxxxx",
"xxxxxxxx-e500-49d6-a705-xxxxxxxxxxxx",
"xxxxxxxx-5be3-41eb-864d-xxxxxxxxxxxx",
"xxxxxxxx-961d-4db9-87cf-xxxxxxxxxxxx",
"xxxxxxxx-93bf-4950-8d96-xxxxxxxxxxxx"
],
"types": [
"group"
]
}
Result:

Customising the API mapping for ng-admin, need a function to change "id" to "_id"

Currently I am using ng-admin to build an admin panel for my webapp.
http://ng-admin-book.marmelab.com/doc/API-mapping.html
This link talks about API mapping and the JSON response expected when ng-admin uses a GET request to get data.
The JSON response format is as follows:
{
"id": 12,
"name": "War and Peace",
"author_id": 345,
"publication_date": "2014-01-01T00:00:00Z",
}
for a book entity defined by name, author_id and publication date.
My REST API returns exactly the same except "_id" instead of "id".
I think this is the reason I can't retrieve data from my API. How can I solve this issue?
Use the entity identifier() method, as explained in the doc (http://ng-admin-book.marmelab.com/doc/API-mapping.html):
var post = nga.entity('posts')
.identifier(nga.field('_id'));

Resources