Cannot create AppSheet table from Apigee X: "Unexpected character encountered while parsing"

@shaaland or any other Apigee experts, can you assist with steps/syntax for AppSheet's manual API Key connection to an Apigee X API? I have read the documentation and watched videos and read cloud threads, and I cannot successfully connect and add a table.

IN APIGEE

  1. We're using a public, third-party API.
  2. We created a test environment.
  3. The organization name appears in the dropdown next to the test environment name.
  4. We created an API Proxy for the third-party API target endpoint. The base path is set to "/basepathname"
  5. We created a product and added an operation for this proxy. Path is set to "/" to allow all. We also added resource paths for the principal API resource paths.
  6. We created an App for this product, added the API and generated the key.
  7. We created a Portal for this because we were required to. It's location appears as org-portalnameportal-apigee.io
  8. All is deployed.

IN APPSHEET

  1. We added a new data source and selected Apigee. (We also tried naming the data source up top and selecting Apigee).
  2. We selected "Manual" tab. Here are the fields:
    1. Authorization Type: We chose "API Key"
    2. Apigee API Key: We entered the app-generated key
    3. Apigee API Base Path: we have tried just entering the base path ("/basepathname"), but it seems to require a URL. The 2020 videos show this field as "Apigee API Base URL," so we have tried multiple variations on URLs: https://org-environment.apigee.nethttps://org-environment-test.apigee.nethttps://org.apigee.net, etc. We've tried with and without the trailing slash. All return this error: "Not connected: Unable to locate Apigee resource. The resource might have been moved, renamed, or deleted." When we entered the portal location URL, it did allow testing and Authorizing Access.
    4. Resource Paths. We added the three resource paths, separated by a comma.
    5. Header. We left these blank and also tried adding Key: Accepted and Value: application/json.

Using the portal location URL did allow authorization, selection of the new data source, and selection of the table. But clicking to add the resource as a table generates this error: "Data table '/resource' is not accessible due to: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.."

In searching online, and in a 2020 thread here, it appears that this is a JSON-related error. But all of the combos above haven't fixed this.

There are videos and documentation, but none I've seen show where to find the required fields or sample syntax, and nothing shows this particular error or how to debug.

Has anyone successfully connected to Apigee X in 2022 and added a table to their AppSheet app who can see what my error is and share steps for completing the above fields correctly?

Thanks.

0 3 172
3 REPLIES 3

@Koichi_Tsuji are you able to share your syntax for finally successfully connecting to Apigee? Thank you.

Can you share a sample response if you call the API with curl or postman, etc..  it can be a snip of just the first two elements, and feel free to obfuscate any private into in the actual data.  I mainly want to see the structure of the JSon payload.  Also, please share the resource paths you are configuring (you mentioned you have 3 paths configured).

You can send it to me at shaaland@google.com .  

My guess, without seeing the details is that the JSON is not putting the table name as the root element.  See these snips from the doc page. Note how the tableName has to match both the API Resource Path and the JSON root element.  ie: /orders in the path has to have a root element of { "orders" : [ ...

API Resource Paths

Comma-separated list of API proxy endpoints. The paths correspond to table names in AppSheet.

...

To get all entries in a table, the Apigee API proxy must support the following API operation:

GET /{tableName}  

Where:

  • {tableName} - Name of the table.

The response body consists of a JSON payload with {tableName} as the key that includes the details for all rows in the table. For example:

{
  "tableName": [
  {
    "ID": 1,
    "TextValue": "Test1",
    "DecimalValue": 1.10,
    "DateTime": "1/1/2016 1:01:01 AM",
    "PhoneValue": "111 111 1111",
    "EmailValue": "email1@appsheet.com"
  },
  {
    "ID": 2,
    "TextValue": "Test2",
    "DecimalValue": 1.11,
    "DateTime": "2/1/2016 1:01:01 AM",
    "PhoneValue": "111 112 1111",
    "EmailValue": "email2@appsheet.com"
  }
  ]
}

Hi, Scott - following up;  I sent an email with the requested info and hoped you were able to figure out what was going awry with Apigee?

Top Labels in this Space