Trying to get data from strapi. I read the instructions
Execute a GET request on the restaurant collection type in order to fetch all your restaurants.
**Be sure that you activated the find permission for the restaurant collection type**
import axios from 'axios';
axios.get('http://localhost:1337/api/restaurants').then(response => {
console.log(response);
});
i create new type "restaurant" in "Content-type builder" and add fields, in "Content manager" created entities of this type. But my answer
{
"data": null,
"error": {
"status": 403,
"name": "ForbiddenError",
"message": "Forbidden",
"details": {}
}
}
I spent a lot of time searching for an answer, but I never found where to activate the find permission. Where is this option?
Do I need to configure JWT validation for that?
Related
I am trying to modify the existing Azure Ad group display name and description from Microsoft Graph API.
I am using the query below:
PUT
https://graph.microsoft.com/v1.0/groups/mygroupobjectid
Body
{
"displayName": "Test_Group1",
"description": "This is my test group",
"groupTypes": [
"Unified"
],
"mailEnabled": true
}
But I am getting the response like below:
{
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"date": "2022-06-15T10:32:53",
"request-id": "253a0a13-f721-4798-911f-d3ab3903da17",
"client-request-id": "8de28bb9-bafe-d186-264d-db614b05a67f"
}
}
}
Can anyone suggest what I am doing wrong? Any help will be appreciated
Please note that, you need to use PATCH method to update properties of existing Azure AD groups via Microsoft Graph API as stated in this MsDoc.
I tried to reproduce the same in my environment like below:
Before updating, my group has properties like this:
To update those properties, I ran query like below:
After executing the above query, properties are updated successfully like below:
I'm trying to use Delphi to call Google Drive Permissions API to create a permission on a team drive. All goes well with the setting on the Google Try It section, but my Delphi code isn't working.
reqPermissions.Body.Add('{role: "organizer",type: "user",emailAddress: "it_admin#mycompany.com"}');
I've tried supplying the type field as a parameter in the Request component, but this also doesn't work. Driving me nuts at the mo, so any help much appreciated.
I always get the following response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "The permission type field is required.",
"locationType": "other",
"location": "permission.type"
}
],
"code": 400,
"message": "The permission type field is required."
}
}
I want to make a translation with Google Translate API v2 with a basic HTTP request. I get an API key from the console but I can't find out how to use arguments to make the translation.
Note: I want it to autodetect the source language and I only want to choose the target language.
This is the URL that I tried to use:
https://translation.googleapis.com/language/translate/v2/detect?fields=detections&key=BIzaSyA8uHGnsA8ICcBWWJcxhqVePGFMq0L4u0g&q=grapes&target=es
It returns this:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"errors": [
{
"message": "Request contains an invalid argument.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
See the documentation.
The authentication token goes in the Authorization request header, not the query string.
https://graph.facebook.com/895895040502397/events/attending/?fields=id,name,description,place,timezone,start_time,cover&offset=0&limit=2000&access_token=xxxxxxx&since=&until=2997993600
With this url I am getting below error.
{
"error": {
"message": "(#100) Tried accessing nonexisting field (fql) on node type (User)",
"type": "OAuthException",
"code": 100
}
}
Any idea how I can fix it.
.../895895040502397/attending...
Remove "events", the ID is already the ID of a specific event.
You can get event like this.
https://graph.facebook.com/895895040502397/attending/.....
Also Use CURL PHP.
As mentioned here I created API key for using cluster operations.
For example for this query:
https://www.googleapis.com/container/v1beta1/projects/PROJECT_ID/clusters
And as mentioned
After you have an API key, your application can append the query
parameter key=yourAPIKey to all request URLs.
I added it to url:
https://www.googleapis.com/container/v1beta1/projects/PROJECT_ID/clusters?key=my_key
But i have error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
I even tried to add key to Authorization part of header...and had this error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
Where is problem? Or did i something wrong?
According to the Google help documentation for API Keys (emphasis added):
An API key (either a server key or a browser key) is a unique
identifier that you generate using the Developers Console. Using an
API key does not require user action or consent. API keys do not grant
access to any account information, and are not used for
authorization.
Furthermore, it says that they can be used to access data that is public or owned by a Google service. The Google Container Clusters (GKE) data is neither of these. I'm not sure why the documentation suggests using an API key, but I know that OAuth works so if you can use that instead you should be able to get the REST API working.