This guide uses cURL and the PDF-to-Markdown endpoint. The same submit-and-poll pattern applies to EPUB conversion.
1. Create an API key
Create an API key in the OOMOL Console. Keep it on your server or in a secret manager; never include it in a browser bundle or public client application.
2. Submit a conversion task
Replace the sample key and PDF URL, then send a request to the submit endpoint.
curl --request POST "https://fusion-api.oomol.com/v1/pdf-transform-markdown/submit" \--header "Authorization: Bearer YOUR_API_KEY" \--header "Content-Type: application/json" \--data '{"pdfURL": "https://example.com/guide.pdf","model": "gundam"}'
The response contains sessionID, which is the task ID. Store it with your own job record and use it in place of TASK_ID below so that retries and downloads remain traceable.
3. Poll for the result
Request the result endpoint until the status is completed or failed, or until your maximum attempt count or deadline is reached. Treat any non-2xx response as an error and stop polling if state is unknown. Begin with a short delay and back off between attempts for longer documents.
curl --request GET "https://fusion-api.oomol.com/v1/pdf-transform-markdown/result/TASK_ID" \--header "Authorization: Bearer YOUR_API_KEY"
Read the task state from state. When it is completed, download the generated file from data.downloadURL; when it is failed, record and handle the returned failure reason.
Next steps
- Review the API overview for authentication, task states, and retries.
- Use the API Reference when you need field-level request and response details.