Expand description
Ghost Admin API client.
Provides write-capable access to Ghost via the Admin API. Every request
carries a freshly-signed HS256 JWT in the Authorization: Ghost <token>
header so that tokens never expire mid-flight.
§Example
use ghost_io_api::auth::admin::AdminApiKey;
use ghost_io_api::client::admin::{GhostAdminClient, AdminBrowsePostsParams};
use ghost_io_api::models::post::PostCreate;
let key = AdminApiKey::new(
"6748592f4b9b7700010f6564:b1b5b9c1d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1"
)?;
let client = GhostAdminClient::new("https://example.ghost.io", key)?;
// Browse posts
let response = client.browse_posts(AdminBrowsePostsParams::default()).await?;
println!("Found {} posts", response.posts.len());
// Create a post
let post = client.create_post(PostCreate::new("Hello, Admin!")).await?;
println!("Created: {}", post.id);Structs§
- Admin
Browse Posts Params - Query parameters for browsing admin posts.
- Admin
Posts Response - Response from
GhostAdminClient::browse_posts. - Ghost
Admin Client - Write-capable client for the Ghost Admin API.