This page guides you through fixing entity errors in JSON entity representations. If you are searching for an XML entity format guide, please, refer to XML Import: How to fix failed Entity.

Datasource

{
    "localId": "81cd54a9-799a-4ff6-be8f-f8fc651107fe",
    "name": "[4/4 Import 2] REST with 2 headers and 2 parameters but missing url and test url",
    "description": null,
    "legacyType": 0,
    "type": "REST_CUSTOM",
    "url": null,
    "driver": null,
    "testUrl": null,
    "username": null,
    "password": null,
    "requestParameters": {
        "Parameter A": "AAA",
        "Parameter B": "BBB"
    },
    "requestHeaders": {
        "Header 1": "111",
        "Header 2": "222"
    },
    "authUrl": null,
    "clientId": null,
    "clientSecret": null,
    "refreshToken": null,
    "accessToken": null,
    "legacyResourceName": null,
    "legacyApplicationLinkId": null,
    "legacyConsumerKey": null,
    "legacyConsumerSecret": null,
    "legacyToken": null,
    "legacyTokenSecret": null,
    "legacySignatureMethod": null
}
JSON
  • localId (required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.

  • name (required)- a unique identifier. This is what users see in the interface when using the Datasource.

  • description - optionally a string containing the entity description.

  • type (required) - determines the datasource type. The value is always one of the following:

  • url (required for REST)- the Datasource basic URL. This URL is used for all associated Queries.

  • user - the username used to log in.

  • password - the password used to log in.

  • requestParameters - a semicolon-separated list of header names and their values. Each list item has the following format: {"Parameter A": "AAA", "Parameter B": "BBB"}

  • requestheaders - a semicolon-separated list of parameters and their values. Each list item has the following format: {"Header 1": "111", "Header 2": "222"}. They will be used in every request.

  • authurl - the URL of the authentication server for OAuth2 Datasources.

  • clientid - the ID of the Client for OAuth2 Datasources.

  • clientsecret - the secret of the Client for OAuth2 Datasources.

  • accesstoken - an access token for OAuth2 Datasources.

  • refreshtoken - a refresh token for OAuth2 Datasources.

  • legacyResourceName - this field should be null.

  • legacyApplicationLinkId - this field should be null.

  • legacyConsumerKey - this field should be null.

  • legacyConsumerSecret - this field should be null.

  • legacyTokenSecret - this field should be null.

  • legacySignatureMethod - this field should be null.

Template

{
    "localId": "8acaf430-07f7-47d6-af7d-832353a6eed7",
    "name": "[Import 1] Template Valid",
    "description": "This is a template.",
    "content": "<h1>$result</h1>"
}
CODE
  • name (required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.

  • displayname (required) - a unique identifier. This is what users see in the interface when using the template.

  • description - optionally a string containing the entity description.

  • content (required) - the body (Apache Velocity code) of the Template.

Converter

{
    "localId": "c68a9de8-5130-4cbf-817d-c3eb29152183",
    "name": "[Import 1] Converter Valid",
    "description": "Here is some example code.",
    "content": "function convert(json) {\n  const parsed = JSON.parse(json);\n\n  return parsed['issues'].map(issue => ({\n    'Issue Key': issue.key,\n    'Summary': issue.summary,\n    ...\n  }));\n}"
}
JSON
  • name (required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.

  • displayname (required) - a unique identifier. This is what users see in the interface when using the Converter.

  • description - optionally a string containing the entity description.

  • content (required) - the body (JavaScript code) of the Converter.

Query

{
    "localId": "9cfdba13-f86c-4421-8262-4cc8b075a7bc",
    "name": "[Import 1] REST Valid",
    "description": "This is a REST!",
    "statement": "/:someApi",
    "datasource": "5de92cd0-c46b-4659-9e47-84b9ff091da9",
    "converter": null,
    "template": null,
    "parameterTypes": {
      "cars": "ListOfStrings",
      "car": "String"
    },
    "legacySpaces": null,
    "legacyIndexed": null,
    "legacyCacheDuration": null,
    "legacyJsonPath": null
}
JSON
  • localId (required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.

  • name (required) - a unique identifier. This is what a users see in the interface when using the Query.

  • statement (required) - a SQL statement or REST URL used to query the Datasource.

  • datasource (required) - the Datasource reference using the Datasource ID (the ID has to refer an existing Datasource)

  • converter - the Converter reference using the converter ID (the ID has to refer an existing Converter or it can be null to use the default Converter)

  • template - the template reference using the Template ID (the ID has to refer an existing Template or it can be null to use the default Template)

  • parameterTypes - a JSON representing parameters and their type. Allowed types are:

    • Boolean

    • Constant

    • Integer

    • ListOfStrings

    • ListOfIntegers

    • String

    • Example: {"cards": "ListOfStrings","car": "String"}

  • legacySpaces - this field should be null.

  • legacyIndexed - this field should be null.

  • legacyCacheDuration - this field should be null.

  • legacyJsonPath - this field should be null.