Skip to main content
May 6, 2024
Solved

Standard Import API error message: Invalid shape type

  • May 6, 2024
  • 2 replies
  • 162 views

Hi! I am trying to use the Lucid Standard Import to create a document with an org chart. The org chart is the only shape in the 1-page document. In the shape object, I have:

"type": "orgChart"

and I am getting a “badRequest” error with the following details:

{
"error": "Count: 1, message: Invalid shape type",
"import_error_code": "invalid_file"
}

 

Best answer by Trevor J

Hello cfitz,

Thank you for your interest in our APIs! I believe I’ve identified the problem. Since org charts must be created from data, we’ve separated them into a object called “dataBackedShapes” rather than “shapes” to show the distinction. Here’s an example of what an org chart json file might look like:

{
"version": 1,
"collections": [
{
"id": "org-chart-data",
"dataSource": "org-chart.csv"
}
],
"pages": [
{
"id": "page1",
"title": "Page 1",
"dataBackedShapes": [
{
"type": "orgChart",
"id": "my-org-chart",
"position": {
"x": 0,
"y": 0
},
"collectionId": "org-chart-data",
"idField": "Employee ID",
"foreignKeyField": "Supervisor ID",
"nameField": "Name",
"roleField": "Role",
"imageUrlField": "Image URL",
"extraFields": ["Email", "Cell", "Location"]
}
]
}
]
}

Note that the only page object has the fields “id”, “title”, and “dataBackedShapes”.

 

Let me know if this doesn’t fix the issue!

Comments

Trevor JAnswer
Lucid product team
May 6, 2024

Hello cfitz,

Thank you for your interest in our APIs! I believe I’ve identified the problem. Since org charts must be created from data, we’ve separated them into a object called “dataBackedShapes” rather than “shapes” to show the distinction. Here’s an example of what an org chart json file might look like:

{
"version": 1,
"collections": [
{
"id": "org-chart-data",
"dataSource": "org-chart.csv"
}
],
"pages": [
{
"id": "page1",
"title": "Page 1",
"dataBackedShapes": [
{
"type": "orgChart",
"id": "my-org-chart",
"position": {
"x": 0,
"y": 0
},
"collectionId": "org-chart-data",
"idField": "Employee ID",
"foreignKeyField": "Supervisor ID",
"nameField": "Name",
"roleField": "Role",
"imageUrlField": "Image URL",
"extraFields": ["Email", "Cell", "Location"]
}
]
}
]
}

Note that the only page object has the fields “id”, “title”, and “dataBackedShapes”.

 

Let me know if this doesn’t fix the issue!

cfitzAuthor
May 6, 2024

Thank you! I am no longer getting that error.