Google Sheets API not accepting my API Key - authorization

I generated an API key through Google Developer's Console. I am trying to read data from a Google Sheet.
However when I do a GET request using the following link:
https://sheets.googleapis.com/v4/spreadsheets/1nUeRttOMn--b46Vt7FIlU_eoOqvvuOyukAEg2L_UGQQ/values/A1%3AF500?key={abcdefghijklmnopqrstuvwxyz0123456789}`
I get the error message:
API key not valid. Please pass a valid API key.
Full error:
{
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console",
"url": "https://console.developers.google.com"
}
]
}
]
}
}
My API Key is valid. How can I resolve the error? I plan to make the API call via Alteryx.

Use this URL:
https://sheets.googleapis.com/v4/spreadsheets/PUT YOUR SHEET ID HERE/values/PUT YOUR SHEET NAME HERE (sheet name not spreadsheet name)?key=PUT YOUR API KEY HERE

I was going through the same error. The Key was valid and I even changed the keys but it was not working.
Here's what I did,
Before the error, it looked like this...
https://sheets.googleapis.com/v4/spreadsheets/PUT YOUR SHEET ID HERE/values/Sheet1?valueRenderOption=FORMATTED_VALUE&key=PUT YOUR API KEY HERE/HTTP/1.1
Then I removed the last bit and got the valid response.
https://sheets.googleapis.com/v4/spreadsheets/PUT YOUR SHEET ID HERE/values/Sheet1?valueRenderOption=FORMATTED_VALUE&key=PUT YOUR API KEY HERE
Worked like a charm!

Related

Google Sheets API Error code 400 API key not valid. Please pass a valid API key

I created a google cloud project and enabled the Google Sheets API. I created and API key that is restricted to Google Sheets API.
I am trying to access my sheet from this link: https://sheets.googleapis.com/v4/spreadsheets/${sheetId}/values/${sheetNameStr}?dateTimeRenderOption=FORMATTED_STRING&majorDimension=ROWS&valueRenderOption=FORMATTED_VALUE&key=${apiKey};
I am getting this error:
{
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_INVALID",
"domain": "googleapis.com",
"metadata": {
"service": "sheets.googleapis.com"
}
}
]
}
}
I have published the entire sheets doc as well as the specific sheet I want to access. The sheet is set up to be viewed by anyone who has the link.
I have tried other forms of the link, and it always comes back to this error. Any suggestions of where to go next is appreciated :)

Unable to create client in Pabau CRM using Pabau API

I am trying to use the APIs that are provided by Pabau CRM to create a client. I am following this link
It keeps telling me that the API key is invalid. I created a new key with all the required permissions. This the request I am making
POST https://crm.pabau.com/OAuth2/clients/create_client.php?api_key=<apikey>&company=1&Fname=firstname&Lname=lastname&section=contacts&Email=germain45#yopmail.com
This is the response I am getting
{
"token": "<token>",
"expiration": "2022-06-08T04:37:15.637Z",
"tenant": "10046314",
"catalog": {},
"success": false,
"message": "Invalid API key."
}
Thanks in advance

Walmart API Error: WM_CONSUMER.CHANNEL.TYPE set null or invalid

My client has a Walmart marketplace store and we are trying figure out how to successfully make the Walmart API's Multiple Item Inventory for All Ship Nodes API call.
The API production URL is :
https://marketplace.walmartapis.com/v3/inventories
The purpose of this call is getting the inventory of the store using the API.
Unfortunately, we are stuck because we don't know what value to put for WM_CONSUMER.CHANNEL.TYPE.
As a result, the API response is unsuccessful and gives this error:
{
"error": [
{
"code": "INVALID_REQUEST_HEADER.GMP_GATEWAY_API",
"field": "WM_CONSUMER.CHANNEL.TYPE",
"description": "WM_CONSUMER.CHANNEL.TYPE set null or invalid",
"info": "One or more request headers are invalid.",
"severity": "ERROR",
"category": "DATA",
"causes": [],
"errorIdentifiers": {}
}
]
}
Where can the value of WM_CONSUMER.CHANNEL.TYPE be found?
I had the same exact issue. I had to open a ticket with support to get the WM_CONSUMER.CHANNEL.TYPE.
Just an FYI, this didn't solve the problem as the value they gave us still resulted in the API returning the same error code.

Mimecast API authentication issue

trying to connect to endpoint with all needed headers defined:
https://us-api.mimecast.com/api/login/login.
Error message receieved : 0018 Client update required
Did anyone encounter/solve this issue?
{
"meta": {
"status": 401
},
"data": [],
"fail": [
{
"key": {
"username": "datadash#itprosusa.com",
"tokenType": "key",
"verifyOnly": false
},
"errors": [
{
"code": "err_xdk_client_update_required",
"message": "0018 Client update required",
"retryable": false
}
]
}
]
}
I came across the same error message when trying to get Access key and Secret Key. You can actually get these in the Mimecast portal UI by going to: Administration | Services | APIĀ Applications, then Add API Application fill in the details and wait 30 minutes. After 30 minutes click on your newly created API application and select Create Keys, fill in the required information and it will provide you with your Access key and Secret key used for API calls.
If this doesn't answer your question or help you I would suggest getting in contact with Mimecast Support, they are usually pretty good!

Twitter Insights API with Postman

I'm trying to read insights of my Twitter account with Twitter Insights API and when I request to that given end point I get and error called :
{
"errors": [
{
"code": "UNAUTHORIZED_ACCESS",
"message": "This request is not properly authenticated"
}
],
"request": {
"params": {}
}
}
This is the end point I tried :
https://ads-api.twitter.com/2/insights/accounts/:account_id/available_audiences
I used the given credentials like Consumer Key, Secret and Token, Token secret.
Can anyone explain me why I'm getting this error ? And what I should do ?
Here is a screenshot
Header:
You have to check box "Add params to header"
Everything else should be ok. Just check Consumer Key, Consumer Secret,... data