



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Engineering Reference · Approval Chain, Email Automation & Instagram Graph API Integration
Screen: Create Campaign page
Screen: Upload Content page
Screen: Compliance Check page
Screen: Flow History / Approval Flow page
Screen: Publish page
5. Instagram Publishing — Implementation
ngrok config add-authtoken # one-time setup ngrok http 8000 # prints the public Forwarding URL
Setting Used for Value in this setup SITE_URL Email approve/reject links opened by humans in a browser on the same machine/network. http://alyousuf.localhost:8000/api INSTAGRAM_MEDIA_BA SE_URL Media URL passed to the Graph API — must be fetchable by Meta's servers. https://.ngrok-free.dev/api Rationale: email links are opened by people already on the same local network/tenant domain, so changing SITE_URL to the ngrok host would have broken nothing functionally but was unnecessary churn — and ngrok's free-tier URL changes on every restart, which would otherwise invalidate already-sent, unexpired approval emails. Splitting the settings means only the Instagram-facing path depends on the rotating tunnel URL.
No tenant for hostname ".ngrok-free.dev" (raised by ninja.operation._sync_view)
Media type Container parameters Notes Photo (.jpg/.png/.gif) image_url + caption Handled by publish_to_instagram(); processing typically completes in 1– polling cycles. Video (.mp4/.mov) media_type=REELS, video_url + caption Handled by publish_video_to_instagram(); polls up to 30 times at 5-second intervals to allow for longer server-side transcoding.
Code Graph API message Root cause & resolution