Blogify Public API
Blogify offers a public API available for all entities to consume. The API allows access to user-data through various endpoints via OAuth2 Authentication.
Table of Contents
- OAuth2
- OAuth2 Application Registration Process
- Application Name (required)
- Application Logo URL(required)
- Application Website (required)
- Application Brand Color (required)
- Application Description (required)
- Company Name (required)
- Company Homepage (required)
- Redirect URIs (at least one is required)
- Permissions (at least one is required)
- Documentation Link (required)
- Privacy Policy Link (required)
- Post-Registration Process
- Authentication
- Endpoints
- Using Access Tokens
- OAuth2 Application Registration Process
- Public API Documentation
OAuth2
OAuth2 Application Registration Process
To register your application for OAuth2 authentication, you'll need to provide the following information:
Note: All text fields i.e. Application Name, Company Name, Application Description must contain only alphanumeric characters, spaces, hyphens, commas, parentheses, periods, or forward slashes.
Application Name (required)
- A unique, concise name for your application (max 3 words, 30 characters)
- Example: BlogSync Pro
Application Logo URL(required)
- A direct link to your application's logo image
- Example: https://example.com/logo.png
Application Website (required)
- The main website for your application
- Example: https://blogsync.example.com
Application Brand Color (required)
- The primary color associated with your application's branding
- Example: #4A90E2
Application Description (required)
- A brief explanation of how your app integrates with Blogify.ai and its benefits (max 300 characters)
- Example: BlogSync Pro seamlessly integrates with Blogify.ai to streamline content creation and publishing across multiple platforms, maximizing user engagement and productivity.
Company Name (required)
- The name of the organization developing the application (max 30 characters)
- Example: TechInnovate Solutions
Note: If your company name and application name are the same, use the same value for both fields.
Company Homepage (required)
- The official website of your company
- Example: https://techinnovate.example.com
Note: If your company's website and application's website are the same, use the same value for both fields.
Redirect URIs (at least one is required)
- A list of allowed redirect URIs for your applciation
- Example:
"https://blogsync.example.com/callback, https://blogsync.example.com/callback/"
Permissions (at least one is required)
- A list of requested scopes for your application
- See Public API section for a list of available scopes
- Example:
"ReadBlog, ReadProfile, SubscribeBlog"
Documentation Link (required)
- A URL to your application's documentation page for this Blogify Integration
- Example: https://docs.blogsync.example.com
Note:
- If your Blogify Integration has a dedicated page in your intgerations directory you can provide that link.
- If your documentation is not prepared yet then provide a dummy link and make sure to update it later.
- If you don't have official documentation for the Blogify Integration, you must still provide some documentation link e.g. a public Google Docs.
Privacy Policy Link (required)
- A URL to your application's privacy policy page
- Example: https://blogsync.example.com/privacy
Post-Registration Process
After registering your application:
-
Initial Status: Your app will remain private, accessible only to the developers.
-
Making the App Public: To make your app available to all Blogify.ai users, you must request an app review:
- Use the "Publish" button in the app portal to initiate the review process.
- You will be notified via the Technical Support Chat System of any required modifications.
- If your app meets all the guidelines, your app will be made public.
-
Editing Capabilities:
- Private Apps: All fields can be edited at any time.
- Public Apps: All fields except for "Scopes" (permissions) can be edited.
-
Requesting New Permissions:
- For published apps requiring additional permissions, you must submit a request through the technical support chat system.
Authentication
This API uses OAuth 2.0 for authentication. Here's a step-by-step guide to obtain and use access tokens:
- Request Authorization: Direct the user to the consent screen to authorize your application.
- Receive Authorization Code: After user consent, you'll receive a short-lived authorization code.
- Exchange Code for Tokens: Use the authorization code to request an access token and refresh token.
- Use Access Token: Include the access token in your API requests for authentication.
- Refresh Access Token: When the access token expires, use the refresh token to obtain a new one.
Important Notes:
- Access tokens are valid for 1 hour.
- Authorization codes expire in less than 30 seconds.
- Refresh tokens do not expire but can only be used once. A new refresh token is provided with each refresh.
Endpoints
Authorization Request
Redirect the user to this URL to start the OAuth 2.0 flow:
GET https://api.blogify.ai/oauth2/v1/connect
Query Parameters:
- client_id (required): Your application's client ID from the Developer Portal.
- redirect_uri (required): The URL to redirect after authorization. Must be registered in the Developer Portal.
- response_type (required): Must be set to "code".
- scope (required): Space-separated list of requested scopes. Must be a subset of the scopes registered in the Developer Portal.
- state (required): A value to maintain state between the request and callback. Can be any string.
Example:
https://api.blogify.ai/oauth2/v1/connect?client_id=your_client_id&redirect_uri=https://your-app.com/callback&response_type=code&scope=ReadBlog%20ReadProfile&state=random_state_string
Once the user authorizes your application the user will be redirected to the callback URL with the authorization code and state as query parameters.
Redirection Example:
https://your-app.com/callback?code=received_authorization_code&state=random_state_string
Token Exchange
Exchange the authorization code for an access token and refresh token:
POST https://api.blogify.ai/oauth2/v1/token
Request Body:
{
"grant_type": "authorization_code",
"code": "received_authorization_code",
"redirect_uri": "https://your-app.com/callback",
"client_id": "your_client_id",
"client_secret": "your_client_secret"
}
Response:
{
"access_token": "access_token_string",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "refresh_token_string"
}
Token Refresh
Refresh an expired access token:
POST https://api.blogify.ai/oauth2/v1/refresh
Request Body:
{
"grant_type": "refresh_token",
"refresh_token": "your_refresh_token",
"client_id": "your_client_id",
"client_secret": "your_client_secret"
}
Response
{
"access_token": "new_access_token_string",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "new_refresh_token_string"
}
Using Access Tokens
To authenticate API requests, include the access token in the Authorization header:
Authorization: Bearer your_access_token
Remember to refresh your access token before it expires to maintain uninterrupted access to the API.
Public API Documentation
Endpoints
Fetch User Information
Retrieve information about the authenticated user and the company they belong to.
Required Scope: ReadProfile
GET https://api.blogify.ai/public-api/v1/me
Response
{
"email": "[email protected]",
"userName": "John Doe",
"role": "user",
"status": "active",
"city": "New York",
"country": "USA",
"profilePicture": "https://example.com/profile.jpg",
"businessName": "Acme Inc",
"website": "https://www.acme.com",
"interests": ["technology", "marketing"],
"subscriptionPlan": "LIFETIME_BASIC",
"subscriptionStatus": "active",
"currentCredits": 1000,
"monthlyCredits": 1000
}
Subscribe to Blog Notifications
Subscribe to receive blog data when user publishes a blog. When user chooses to publish a blog via your intgeration, the blog's information will be POSTed to the provided webhook URL. See fetch blogs endpoint for more details about blog posts.
Required Scope: SubscribeBlog
POST https://api.blogify.ai/public-api/v1/subscribe
Request Body
{
"hookUrl": "https://example.com/webhook",
"label": "My Webhook"
}
Response
{
"id": "https://example.com/webhook",
"message": "Subscribed successfully"
}
Unsubscribe from Blog Notifications
Unsubscribe from blog publish notifications.
Required Scope: SubscribeBlog
DELETE https://api.blogify.ai/public-api/v1/subscribe
Request Body
{
"hookUrl": "https://example.com/webhook"
}
Response
No content (204 status code)
Fetch Blogs
Retrieve a list of blogs for the authenticated user.
Required Scope: ReadBlog
GET https://api.blogify.ai/public-api/v1/blogs?limit=20&offset=0
Query Parameters
- limit (optional): The number of blogs returned
- offset (optional): The starting index for returned blogs
Response
{
"data": [
{
"title": "Sample Blog Post",
"content": "This is a sample blog post content.",
},
// ... more blog entries
],
"total" : 100,
}
Note: Please do not make your application rely on undocumented fields as they may change in the future.