Hey @liyouliang,
Thank you for brining this up! Our documentation isn’t extremely clear on the differences between these endpoints, so I’ll try to clear up any confusion here.
-
The account_media endpoints are used to process any media files (either video, gif or images) after they’ve been uploaded using the POST media/upload endpoint. The account_media endpoint will process the uploaded files and generate an id that can be used to associate this media with any Twitter Ads campaigns.
-
The media_creative endpoints, on the other hand are used to associate these processed media files (i.e., after the account_media step is complete) with a line_item.
Therefore, using the example mentioned on Github, i.e, the video_tutorial.py script, this script breaks down into the following steps.
- Upload the media (image/video) using the upload endpoints to get the
media_id or video_id
- Create the necessary
account_media to process the files after uploading in Step 1
- Use the
media_creative endpoints to add any additional data (like landing_url) and associate the media with a given line_item
Hope that clears things up!