Search API Connector Documentation

Print

Error Messages

You may encounter the following error messages while using the API Connector add-on for Google Sheets.

drive.google.com refused to connect

Similar to the “ScriptError: Authorization is required to perform that action” error message, this error from Google occurs when logged in into multiple Google accounts at the same time. Instead of seeing the regular add-on interface, you’ll instead see an image like this:
error-messages-img2

This is a known bug, so hopefully will be fixed by Google at some point. Until then, you can resolve this issue by logging out from all other accounts before running the add-on, or by opening in a new incognito window.

ERROR: Please enter request name

All API requests must have a name before they can be run. This is true even if you don’t save the request. Enter a name (as a best practice, choose a name that will easily differentiate the request from other API requests in your sheet).

ERROR: Please enter API URL path

All API requests must contain an API URL. This URL should consist of at least a domain name and endpoint, e.g. www.apisite.com/v1/data. Optionally, it can also contain query strings, e.g. www.apisite.com/v1/data?query=A&query=B.

ERROR: Destination sheet doesn’t exist

You’ll see this error if you run your request without a destination sheet. To resolve, set a destination sheet in your request before clicking Run.

ERROR: Pagination can not be applied to multi-query requests

Pagination handling and multi-query requests both cause API Connector to run multiple API requests in a single call, so they can’t be used together. To resolve, please remove pagination handling (located under Output Options) or make sure that you’ve entered only a single URL into the API URL Path field.

Failed to run request

This error indicates that the request is unable to complete successfully, but didn’t return any specific information about the cause of the problem. The primary cause of this error is a request that takes too long to complete and therefore hits Google’s 6 min/request processing limits as described here.

To address, try any or all of the following:

  • reduce the size of your request. Most APIs provide some mechanism for limiting response size via query strings that filter for date or type.
  • change the report style to “compact”, as this is the fastest mode.
  • if you are using pagination handling, turn off the “fetch all” option and add in a page count limit instead. When you select “fetch all”, some APIs continuously send back data such that your request times out. Adding a page count sets a stopping point so your request doesn’t run forever.
  • use JMESPath filtering (paid feature) to reduce the number of fields printed into your sheet.

Failed to save request as the name already exists.

All API requests must have a unique name. If you re-use a name that already exists, the request will not save. To resolve, change the request name and retry.

Internal error executing the custom function

This error comes from Google, and means that your custom function has taken too long (more than 30 seconds) to execute (documentation).

To address, run your request using the standard sidebar method rather than with the IMPORTAPI() custom function.

Request failed: Access not granted or expired.

This error occurs when you use the OAuth 2.0 connection feature of API Connector. It means your connection hasn’t been activated, or access has expired. To resolve, navigate to the Connections screen and make sure your OAuth 2.0 connection is active. If you are not using a preset OAuth 2.0 connection, make sure you’ve selected Authentication = None.

Request failed: Attribute provided with invalid value: Header:HeaderKey

This means you’ve entered an invalid header key. Please check your API documentation and make sure you’ve entered the header key exactly as written; e.g. if the header key is ‘api-key’ make sure you haven’t entered ‘apikey’. Also double-check that you haven’t inadvertently pasted in an errant space or other character at the beginning or end of your header key.

Request failed: Bad request

This means the API URL hostname is malformed. A request like http://87000 would trigger this error. Make sure you’ve entered a valid API URL, including a full hostname.

Request failed: Data storage error

This is a temporary but recurring bug on Google’s side related to the getProperty() method for saving triggers and requests. Bug reports have been filed and acknowledged (e.g. here, here, and here).

If you receive this error, please wait and try your request again later.

Request failed: DNS error

This means the server you’re trying to reach doesn’t exist or isn’t responding. Check if your server has reported any outages. If not, double-check your API URL and run again.

Request failed: Expected argument of type object, but instead had type boolean

This means that the server has responded with a boolean, i.e. ‘true’ or ‘false’, instead of a standard JSON object. API Connector only supports JSON, XML, and text/CSV responses (and receiving a true/false response to your request usually indicates some issue with the request itself).

Request failed: Expected argument of type object, but instead had type number

This means that your response output is a number when API Connector was expecting JSON. The most likely cause of this is a JMESPath query set to extract just a single number. To address, make sure your query returns a valid object, e.g. if you have a field named ID, add a JMESPath query of {id:id} rather than simply id.

Request failed: Invalid argument

This occurs when your URL contains an invalid character, like a space or bracket. There are 2 common causes of this error:

  1. copying & pasting code snippets like ‘GET’ into the API URL path box. This field can only accept a valid URL.
  2. not replacing example variables with actual values:
    Wrong: https://www.googleapis.com/youtube/v3/search?part=snippet&key={API_key}
    Right: https://www.googleapis.com/youtube/v3/search?part=snippet&key=123456789

Request failed: Invalid POST body data

This error occurs when your POST body is incorrectly formatted. Ensure your POST body is valid JSON. Consult this article for more detailed instructions: Add a Request Body to a POST Request

Request failed: Server responded with an error (###)

This error message occurs when the API you’re trying to connect to refuses to run your request and has returned an HTTP Response Status error code.

Server errors come from the API, not from API Connector, so we can only give some general troubleshooting suggestions. First, click “show response” to see the exact error message returned by the server. This will often alert you to the specific nature of the problem.
error-messages-img1

You can also look up the HTTP error code displayed within the parentheses. This site contains brief explanations for all error codes: https://httpstatuses.com.

In general, common causes of server errors include:

  • you have entered a non-existent or malformed API URL. Your API URL should look like a standard web URL, and shouldn’t include special characters like ‘{‘ or ‘<‘.
  • your request contains misspelled or missing Header keys. Double-check the requirements; if you need to enter a header key named ‘api-key’, it won’t work with ‘apikey’.
  • the API endpoint only accepts HTTP POST requests but you’re sending a GET request (or vice versa)
  • you’ve included an invalid parameter (e.g. ‘num=50’, when the value of ‘num’ must be less than 20)

To resolve, please check the documentation of your API service, and ensure your request matches all requirements exactly.

Request failed: Server response not in JSON, XML, or CSV format

This error occurs when the server responds with data in an unsupported format, e.g. an image or a boolean. One common cause of this error is a request containing an invalid JMESPath expression.

Request failed: This action would increase the number of cells in the workbook above the limit of 5000000 cells.

Google Sheets permits a maximum of 5 million cells (documentation) per sheet, including empty cells. Therefore, you will see this error message from Google if your request would cause your sheet to surpass the limit. To address, try any or all of the following:

  • Run your request in a fresh new sheet
  • Split your requests into separate worksheets
  • Delete any unused tabs, rows, and columns from your worksheet
  • Limit the size of the data response you’re requesting
  • Use JMESPath filters to print out fewer fields
  • Change the report style to compact.

Request failed, cannot find function split in object true

This error message is associated with the IMPORTAPI custom function. It occurs when you’re missing the middle argument in your request. To resolve, make sure you’ve included the middle argument, even if it’s empty, like this:
=IMPORTAPI("Request","",$A$1)

Request processed, no records found

This is more of a notification than an error message. It means that there is no issue with the setup of your API request, but the API service returned an empty response. If you were expecting data in the response, make sure you’ve entered the correct API URL and re-run.

ScriptError: Authorization is required to perform that action

This is an error from Chrome that sometimes occurs when you have multiple Google accounts open in the same session. To resolve, sign out of your other accounts, or re-open the add-on in a new incognito window.

Service invoked too many times for one day: urlfetch

This error message comes from Google itself. Google has quotas on its usage, as described here: https://developers.google.com/apps-script/guides/services/quotas. A URL Fetch call is a request to get a URL, so one API request is one URL fetch call, and URL Fetch calls are limited to 20,000/day for consumer accounts.

Please note that Google applies this limit to each individual account (each email address), and sums together all the fetch calls from all the sheets you’re using. This includes all scripts, functions, and other add-ons that you may be running in addition to API Connector. Unfortunately Google doesn’t provide any breakdown of where URL fetch calls come from, or any indicator of how close you are to the limit, so you will need to review your sheets manually for excess URL fetch calls.

Pay special attention to functions like importJSON(), GoogleFinance(), and API Connector’s own importAPI() as these may produce URL fetch calls every minute. To prevent functions from running repeatedly, you can wrap them in a switch() or if() statement that explicitly defines the condition under which they should re-calculate.

Other:

In some cases, API platforms will accept a request but return an error message containing additional requirements or information as their response. In those cases, their custom error message will be displayed in the output sheet.

16 thoughts on “Error Messages”

  1. Hello, I have used your template and I think I follow the configuration steps well but it gives me the following error:

    Status
    ERROR: Pagination can not be applied to multi-query requests.

    Reply
    • Hi there, pagination handling is a function that loops through a URL and runs a request multiple times. Multi-query results run through a list of URLs and run multiple requests in a single call. Since these 2 functions both run multiple requests, they can’t be used together. To resolve, please remove pagination handling (under Output Options) or make sure you’ve entered only one URL into the URL field. I’ll add this error message to the list, thanks for pointing it out!  

      Reply
  2. Hello, thanks a lot for your tutorials, they are very clear. I tried to follow your tutorial to connect the facebook API to google sheet, but when I do the API request in the API connector, I get “Request processed, no records found”.

    My page have data though. Is there a reason why no data are retrieved by the API ?

    Thank you for your help

    Reply
    • Hi Arthur, thank you for the message. That message just means that Facebook hasn’t sent back any response data (which means your URL is requesting data that doesn’t exist). For example, you may have included a filter for an unavailable metric or account ID, or requested fields that don’t contain any data. Can you get any response data back? I suggest running a very simple request first to confirm that you have the right account ID and base URL, and then adding on metrics and complexity after that. If you share your URL with me I can also take a look.

      Reply
  3. Hello, thank you for your clear tutorials. I’ve encountered an error message ; “Server responded with an error (500)”. It seems this error occurs when internal server have problems. Can you explain more about this issue?

    Thank you for your help.

    Reply
    • Hi Sean, thank you for the message and sorry you’re having trouble with your request. You can read about this error message here, but basically a 500 Internal Server Error is a generic error message from your API (not from API Connector) meaning that something has gone wrong but the server hasn’t provided any information on the problem. So we really can’t say much about it.

      I suggest following the API documentation exactly and running a very simple request to check if you can at least establish a basic connection. If you continue to see this error even after that, you would need to reach out to the API and see if they have any server logs that can provide more information into the exact nature of the problem.

      Sorry for the inconvenience, but I hope that helps clarify where this error comes from. If you share your API docs and sheet with me, I’ll be happy to take a look too.

      Reply
  4. Hi I’ve created a report as a free user and then registered as a “pro”
    and didn’t change anything in the report
    but
    now it pops up an error message “OAuth2 connections are available only for Business plan users. Please upgrade for access.”

    what changed?

    Reply
    • Hi Hagay, OAuth2 connections are only for Business users, but you registered as a Pro user, so that’s why you received this error message. You can see the difference between the plans here: https://mixedanalytics.com/api-connector-pricing/

      If you had access before, and now you don’t, the most likely reason is that you installed the add-on within the past week. When you install the add-on, you receive a 7-day free trial that temporarily activates all features, including those from the Business plan.

      Sorry for any inconvenience, let me know if you have any other questions or would like to cancel/refund your subscription.

      Reply
    • Google has a limit on the length of URLs it will accept (2kb as described here). So basically you need to remove parameters or otherwise reduce the size of your URL.
      Based on this Stack Overflow post, it might be possible to use a URL shortener, but I haven’t tried that myself.

      Reply
  5. Hi, i ran into this error, please help me

    Completed with errors
    – Server responded with an error (403) show response ERROR: The request could not be satisfied 403 ERROR The request could not be satisfied. Request blocked. We can’t connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. Generated by cloudfront (CloudFront) Request ID: z_FQKimUJf6qa-PDBBGPHXWyXmUK55tCCl-Y0UqbN11vXWrcAr851w==

    Reply
    • Hey Bryan, 4xx errors come from the server, not from API Connector, so you would need to contact them to see why they’re giving you this error. Based on the error message, though, it’s related to Cloudfront, so I suspect it’s related to bot protection. You can try running this request in an API tool like Postman to see whether they are injecting a Cloudfront page in front of the data.

      Reply
  6. Hi, API works fine for most time but lately it started popping out this message:

    Status
    Completed with errors

    No other info aside that. It doesn’t refresh any data though. Any thoughts why this happens and how to bypass it? Thank you!

    Reply
    • Hey Zika, please run the requests individually from the Create screen to see individual error messages for each request URL. You can also enable logging for your requests from the Schedule screen, that will also help you identify which specific requests are failing. Finally, if it’s only failing sporadically, I suspect you’re running into rate limits from your API, which API is it?

      Reply
  7. Hi, i tried to request but here’s the result
    Completed with errors
    – Server responded with an error (503) show response 503 Service Temporarily Unavailable 503 Service Temporarily Unavailable

    Reply
    • Hi there, this is an error from the server (i.e. the API), not API Connector. They are saying they are temporarily unavailable, which means you need to wait and try again later. Which API is it? I can help you check their documentation if you like.

      Reply

Leave a Reply to Ana Cancel reply