79735009

Date: 2025-08-14 06:22:34
Score: 1
Natty:
Report link

Did you use the correct mediaID/mediaType for reels and videos?

I'll share my own basic CLI for posting images and videos to Instagram, and you can see how the use the media type correctly.

social-cli

You can check the code snippet.

func createMediaContainer() (string, error) {
    endpoint := fmt.Sprintf("https://graph.instagram.com/%s/%s/media", config.Version, config.IGID)
    data := url.Values{}

    if mediaType == "video" {
        data.Set("media_type", "REELS")
        data.Set("video_url", mediaURL)
    } else {
        data.Set("image_url", mediaURL)
    }
    data.Set("caption", caption)
    data.Set("access_token", config.Token)

    resp, err := http.PostForm(endpoint, data)
    if err != nil {
        return "", err
    }
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    if resp.StatusCode != 200 {
        return "", fmt.Errorf("API error: %s", string(body))
    }
    return parseID(body), nil
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Did you use the
  • Low reputation (1):
Posted by: ihsan özlü