Your newsroom.
Connected.
Publish stories, deliver media and power your publication. Everything you need to integrate with Bangla Print, in one reference.
curl --request GET \
'https://api.banglaprint.com/api/posts?limit=5' \
--header 'Accept: application/json'
A clear path to your first integration
Authenticate your application
Start a cookie session, handle two-factor login and understand route permissions.
Authentication guide → 02 / INTEGRATEWork with your content
Find routes, inspect parameters and copy a request in cURL or JavaScript.
Content endpoints → 03 / HANDLEBuild a reliable client
Handle pagination, validation failures, access restrictions and throttling.
Responses & errors →https://api.banglaprint.com/apiRoutes and available validation rules are read from the application. Conditional rules and inferred response fields are a reference, not a complete OpenAPI contract.
Authentication
Protected routes use the HttpOnly auth_token cookie. Sign in once, then let your browser or API client's cookie jar send the cookie on subsequent requests.
Sign in and save the cookie
Send your email and password to POST /api/login. A successful login without 2FA sets auth_token through the Set-Cookie response header. For cURL, save and reuse the cookie jar below.
curl --request POST 'https://api.banglaprint.com/api/login' \
--cookie cookies.txt \
--cookie-jar cookies.txt \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"email":"editor@example.com","password":"YOUR_PASSWORD"}'If the response contains requires_2fa: true, complete POST /api/2fa/verify with the returned temp_token and your code in otp. The authentication cookie is set after successful verification. Use the same cookie jar or browser credentials option for this request.
Include browser credentials
Use credentials: "include" for browser requests, including login. The browser stores and sends the HttpOnly cookie automatically; JavaScript does not need to read it or set an Authorization header.
const login = await fetch('https://api.banglaprint.com/api/login', {
method: 'POST',
credentials: 'include',
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify({ email: 'editor@example.com', password: 'YOUR_PASSWORD' })
});
const result = await login.json();
if (!login.ok) throw new Error(result.message || 'Login failed');
if (result.requires_2fa) {
// Complete POST /api/2fa/verify with temp_token and otp first.
} else {
const session = await fetch('https://api.banglaprint.com/api/auth/check', {
credentials: 'include',
headers: { 'Accept': 'application/json' }
});
console.log(await session.json());
}Check access and end the session
GET /api/auth/check returns the current authentication state in data.authenticated. POST /api/logout ends the current authenticated session. Send cookies on both requests.
Postman setup
Import the exported collection and set base_url to your API origin. Keep the cookie jar enabled and send the login request first, completing 2FA if required. Postman stores auth_token and sends it to matching API URLs. Collection requests use No Auth because authentication comes from the cookie jar.
Permissions & signed URLs
The explorer lists every permission middleware group on a route. A pipe (|) means any permission in that group is accepted; separate groups must all pass. Policies and ownership checks may impose further restrictions.
A signed URL requires its original signature and any expiry parameters. Use the complete URL supplied by the API; a login cookie does not replace its signature.
The current authentication cookie uses HttpOnly, Secure and SameSite=None. Use HTTPS in deployment and a cookie domain/path matching the API URL. Cross-origin browser requests also need an explicitly allowed frontend origin and credential support in CORS. If login succeeds but a protected request returns 401, check the browser's cookie storage and request headers. The live explorer uses your existing browser session for this API.
Responses & errors
Use the HTTP status code to determine the result. Response envelopes and pagination vary by endpoint.
JSON responses
Many endpoints return success, message, data and statusCode. These keys are not universal: downloads, text responses and framework errors use different formats.
Pagination
GET /api/posts accepts limit and page, and returns meta.current_page, meta.last_page, meta.per_page and meta.total, with items in data. Media listings place the paginator inside data, including items at data.data. Check each endpoint before sharing a pagination adapter.
| Status | Meaning | Client action |
|---|---|---|
200 / 201 | Successful request / resource created | Read the endpoint's response. |
401 | Unauthenticated | Sign in again and check that the auth_token cookie is sent to the API. |
403 | Access denied | Check account status, permissions, ownership or URL signature. |
404 | Resource unavailable | Check the identifier and publication visibility. |
409 | Conflict | Refresh the resource before retrying an update. |
422 | Validation failed | Display field errors and correct the payload. |
429 | Rate limit exceeded | Respect Retry-After when present; wait before retrying. |
5xx | Server error | Record the failure; use bounded retries for safe reads. |
Validation errors
Standard Laravel validation failures return an errors map. The following is an illustrative response; message wording can vary.
{
"message": "The email field is required.",
"errors": {
"email": ["The email field is required."]
}
}Rate limits & retries
Explicit route throttles appear in the explorer as requests / minutes. Infrastructure may apply additional limits. Do not automatically retry publishing, voting, uploading or other writes: repeating a request can create duplicate effects.
Response field maps are inferred from controller and resource code. They can combine success and error branches and omit fields assembled by services. An empty map means no fields were extracted, not that the response is empty. Use the live GET response or inspect the relevant workflow for the actual payload.
Media uploads
Upload a file with multipart form data, then use the returned media identifier in the relevant content or advertising workflow.
Upload a file
POST /api/media requires an authenticated cookie session and the route's upload permission. Send the file in file. Optional fields are collection, title and source.
curl --request POST 'https://api.banglaprint.com/api/media' \
--header 'Accept: application/json' \
--cookie cookies.txt \
--cookie-jar cookies.txt \
--form 'file=@/path/to/photo.jpg' \
--form 'title=Newsroom photograph' \
--form 'collection=uploads'Do not manually set Content-Type when using browser FormData or cURL --form. JSON requests cannot carry uploaded files.
File validation
The general upload endpoint accepts JPEG, PNG, WebP, GIF, SVG, PDF, DOC and DOCX, up to 10 MB per file. Individual workflows can impose stricter file type, size or dimension limits.
Use the returned URL
Use the media URL returned by the API. Do not construct a URL by prepending /storage: assets can use private storage, generated variants or signed delivery URLs.
Updating resources with files
Check which methods the endpoint supports. Where a multipart POST alias exists, use it. For a PUT/PATCH route, a multipart POST with _method=PUT or _method=PATCH can use Laravel's method override. Regular JSON updates use the documented method directly.
API reference
Find the right endpoint, inspect its parameters and build your request.
Try a shorter search or reset the filters.