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

How to inject resources programmatically in apptext #32

Closed vallieresc closed 1 year ago

vallieresc commented 3 years ago

Hey, is there a way I can programmatically inject resources in apptext? In your API I see no insert or create methods. I know this goes against the way of a stringlocalizer but it would be the best approach for my app. I currently use GetString() and your add if not found feature to create all entries.

I would also like to know if it would be possible to add collections programmatically. I would like to create one collection per model as it would make it clearer to editors.

Maybe the only thing you need is additional API methods.

martijnboland commented 3 years ago

Currently, only the public API is documented, but AppText also has its regular REST API that can be used. You could spy on the XHR requests that the admin app makes what that looks like. These endpoints cannot use the API-KEY authorization, but depend on how authorization for AppText is configured.

In the meantime, I'll add Swagger/OpenAPI to the docker image and the demo app, so you can get a complete overview of REST API. BTW, the hostappexample project is also configured with Swagger. You can run that project and navigate to /swagger to see all available endpoints.

martijnboland commented 3 years ago

Swagger is added to the public demo. Here you can get a complete overview of the API: https://demo.apptext.io/swagger/index.html