Insert blog in project

i have run squidex with iis and i create a schema for blog page but i dont know how i insert this page in my project code ( code is mvc core )
what can i do ? what the steps
thanks ,

You can access the blog page through the API.

In PHP you can use “curl”, and in Javescript you can use “fetch” to query the API.

https://docs.squidex.io/02-documentation/developer-guides/api-overview/authentication

1 Like

@ahmed_hassan Take a look at the Squidex.ClientLibrary package: https://github.com/Squidex/squidex-samples/tree/master/csharp/Squidex.ClientLibrary

Add the respective NuGet package to your project.

Try to follow the README.MD there although the Readme is a little bit outdated in terms of step 3 (In https://github.com/Squidex/squidex-samples/commit/c1e64071db7d3d4be829e368531674f03ec42730, @Sebastian marked the methods used in the README.md as obsolete)

My recommended way to use Squidex.ClientLibrary

  1. You don’t want to create the client classes yourself. Instead, clone https://github.com/Squidex/squidex-samples/tree/master/csharp/Squidex.ClientLibrary, open Squidex.ClientLibrary.sln and set CodeGeneration as your startup project. Enter your credentials there. Run the code, take the generated Generated.cs file and insert it into your ASP.NET Core MVC project.
  2. Initialize the client manager
  3. Adjust this code to your schema’s name:
var httpClient = clientManager.CreateHttpClient();
var yourBlogClient = new BlogClient(httpClient); // name of the class depends on your schema's name and, therefore, the generated classes are called
var yourData = yourBlogClient.QueryBlogContentsAsync(); // replace `Blog` with the name of your schema

from where can i get my credentials of my blog schema
thanks,

@ahmed_hassan
In cloud.squidex.io select your app, go tot settings -> clients and use the credentials shown there.

@ahmed_hassan

I created to pull request to update the documentation: https://github.com/Squidex/squidex-samples/pull/39