martijnboland / apptext

AppText is a content management system for applications. Application developers can use it to replace static resources in applications with dynamic content and delegate content management to non-developers.
https://apptext.io
Apache License 2.0
23 stars 5 forks source link

API to create collection #35

Closed vallieresc closed 3 years ago

vallieresc commented 3 years ago

Hi @martijnboland

I need a way to create a collection with your API. I don't see any way to do that. Is there a way or can you refactor to post a collection name?

Thanks.

martijnboland commented 3 years ago

There is a way to create a collection with the API: POST to /{appId}/collections with the following payload:

{
    "name":"mycollection",
    "contentType":{
        "id":"a5858fa0-63ec-4da1-bd78-1111f68f3ed9"
    },
    "listDisplayField":"text",
    "description":"description of my collection"
}

You'll need to know the ID of the content type of the collection. The list of content types is also available via the API /{appId}/contenttypes?includeglobalcontenttypes=true&name=Name_of_ContentType.

vallieresch commented 3 years ago

Done, it works!