Creating a new Document via the API?

I can’t find any info on how to create a new Document via the API. Any help?

This might be undocumented on purpose so be careful!

I had a similar problem and found that documents are of type “fibery/view”. You can create document content via “/api/documents” (Fibery API) and then create a document entity via “fibery.entity/create” with “type”: “fibery/view”. For details check your schema under “fibery/view”. Query below uses existing document to give you an idea - should take you quite far:

 {
  "command": "fibery.entity/query",
  "args": {
    "query": {
      "q/from": "fibery/view",
      "q/select": [
        "fibery/id",
        "fibery/container-type",
        "fibery/container-entity-id",
        {
          "fibery/container-app": [
            "fibery/id"
          ]
        },
        "fibery/meta",
        "fibery/public-id",
        "fibery/type",
        "fibery/name",
      ],
      "q/where": ["=", ["fibery/public-id"], "$id"],
      "q/limit": 1
    },
    "params": {
      "$id": "xxx"
    }
  }
}
1 Like

@mdubakov, is it safe to use @Pawel_Badenski’s suggestion to create a Document? Or will that interface be deprecated?

Hi!
there will be no fibery/view type at all.
We have a separate task to make public API for documents/views management out of our internal API so it will be available soon - 2-3 weeks.

Bottom line:

I can’t find any info on how to create a new Document via the API. Any help?

Currently there is no public API for view/documents. It will be available in 2-3 weeks i hope :pray:

1 Like