AtTask getApiKey action returns unsupported action error - api-key

I'm following the directions in the AtTask API documentation to get an API key. My user is a system administrator, but the request always returns an error.
Request:
GET /attask/api/v4.0/user?action=getApiKey&username=user#company.com&password=********&method=put
Response:
{
"error": {
"class": "java.lang.UnsupportedOperationException",
"message": "APIModel V4_0 does not support action getApiKey (USER)"
}
}

the following should work
GET /attask/api-unsupported/user?action=getApiKey&username=user#company.com&password=********&method=put

It seems that now api keys are supported only in the latest (unstable) version of api. Try to pass unsupported or internal instead v4.0.
That way you will get the latest features of api.

Related

Can't access Chorus Pro API in Postman

I'm working on a custom module for Odoo 15, but I'm currently facing an issue with the Chorus Pro API.
Everything about authentication and API key generation looks ok on their website.
But when I try some requests in Postman it always returns me "400 Bad Request" and I don't understand why.
Can someone help me ?
Thanks.
Update 1
Ok so after several tests it return me "Unable to find token in the message".
But I specified it in the Authorization menu with type API Key.
Here the official documentation: https://developer.aife.economie.gouv.fr/index.php?option=com_apiportal&view=apitester&usage=api&apitab=tests&apiName=Factures&apiId=5feff6ae-09cd-46a6-a0b9-844eac6b9acc&managerId=2&type=rest&apiVersion=1.0.0&Itemid=265&swaggerVersion=2.0&lang=fr
(Sorry it's in french)
Update 2
I finally get an API Key and change the Authorization Type to Bearer Token so the previous error is solved.
But now I've got "403 Forbidden" because of an "[invalid field]".
I use this POST URL : https://sandbox-api.piste.gouv.fr/cpro/factures/v1/corriger/valideur/facture
With this body :
{ "idFacture": 0, "idStructure": 0, "typeIdentifiantStructure":
"SIRET", "identifiantStructure": "string" }
Update 3
The "[invalid field]" seems to be the host one, but it's the same as in the POST URL : sandbox-api.piste.gouv.fr

When trying to update a video snippet I always get a Forbidden response

I am creating an app to update my videos through the youtube api v3.
I have set up everything correctly according to the documentation. Have the API key and OAuth credentials. But everytime I try to update (in my app or in the API test page) I get this json response:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://youtube.googleapis.com/youtube/v3/videos?part=snippet&alt=json returned "Forbidden". Details: "[{'message': 'Forbidden', 'domain': 'youtube.video', 'reason': 'forbidden'}]">
I'm getting so frustrated, this specific error only shows "Forbidden" with no extra info.
Does anyone knows what it could be? Thank you
X

Which API's are needed to get enabled for Google Custom search?

We are calling API by URL:
https://www.googleapis.com/customsearch/v1?key=MY_KEY&cx=CUSTOM_SEARCH_ID&q=flower
Getting error in reponse:
"error": { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." } ], "code": 403, "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project." }
We have enabled Custom Search API and Google + API. Still getting above error. should we need to enable some other API too?
Please help.
No, I believe that custom search API is the only API that you need to enable.
So, I would consider whether you have the right key and CSE ID.
To verify your CSE ID, do a test query from here (fill in ):
https://console.developers.google.com/project/PROJECT_ID/apiui/api/customsearch/method/search.cse.list
If your query works there, but still doesn't work in your code, then perhaps the issue is your key. If you are just doing a simple URL request (as you show in your Q), then I would expect you are using a server key. And, of course, the key you are using must be from the same project where you have enabled the CSE API.
Go to https://console.developers.google.com/apis/dashboard
In the dashboard screen there is an Enable API link(near Dashboard heading)
Choose the API you want to enable.
The enabled API will be listed in the dashboard.
Call the API by URL and check.

Google Custom search API returning Access Not Configured

We are calling API by url:
https://www.googleapis.com/customsearch/v1?key=MY_KEY&cx=CUSTOM_SEARCH_ID&q=flower
getting error in reponse:
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
WE have enabled Custom Search API and Google + API. Still getting above error. Should we needto enable some other API too?
Please help.
(I'm repeating here the answer I gave you here).
No, I believe that custom search API is the only API that you need to enable.
So, I would consider whether you have the right key and CSE ID.
To verify your CSE ID, do a test query from here (fill in ):
https://console.developers.google.com/project/PROJECT_ID/apiui/api/customsearch/method/search.cse.list
If your query works there, but still doesn't work in your code, then perhaps the issue is your key. If you are just doing a simple URL request (as you show in your Q), then I would expect you are using a server key. And, of course, the key you are using must be from the same project where you have enabled the CSE API.

Google plus API Issues

Working with Google Plus API, I have enabled the google+ api in developer console and regenrated the appkey multiple times and trying to access the profile using profile.get but everytime i am getting the following issue:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
Here is the link, i am trying to do:
https://www.googleapis.com/plus/v1/people/113377691202864347297?key={myKey}
passing my generated key for that domain, i am getting the above error. why it is not working
Screenshot of Enabled API's
I am guessing you're using the wrong API key. The API key is not a client ID or a client secret - it shouldn't have '.' in it. In the new console (https://developers.google.com/console) they are generated under the Credentials > Public API Access section and should look something like 'AIzaSyC-iPgOiU2hSqnpjc-KrtHpwThsWh_hQdO'.
If you've made one make sure that the allowable IP addresses or browser URLs (depending on key type) include the one you're making the call from. I included a screenshot of the key section below.
Which jar should i include for retrieving public posts of user.
Iam using google+ v1 api jars but there seems to be some problem with json. It is not able to resolve it.