Skip to content

Generate Publisher Sharing Links in Batch

POST
/affiliate_creator/202504/affiliate_sharing_links/publisher/{publisher_id}/generate_batch

You can use this API to generate material sharing links for a specific publisher. After that, you can share the link with the publisher. Right now, the material type must be PRODUCT. Please ensure that the material is included in the campaign by using Generate Multi Affiliate Partner Campaign Product Links.

publisher_id
required
string

The publisher id in partner’s system

Media typeapplication/json
object
material
required

The entities for which the sharing links are generated.

object
ids
required

The list of material IDs. The maximum length is 50. When type is PRODUCT, provide 1 to 50 product IDs.

Array<string>
type
required

The material type. Possible values:

  • PRODUCT: Provide product IDs in ids.
  • CAMPAIGN: Provide promotion_campaign_schema.
string
Allowed values: PRODUCT CAMPAIGN
promotion_campaign_schema

When type is set to CAMPAIGN, this field is required. This schema is associated with the Campaign page.

string
campaign_id

If a creator adds products from a campaign, please include the campaign ID. The campaign ID can be found in the Affiliate Center or retrieved using the Get Affiliate Partner Campaign List API.

string
link_type

Controls the sharing_link returned when material.type is PRODUCT.

  • Set to TOKO for a Tokopedia product URL. This option is for Tokopedia agencies.
  • Omit this field for a TikTok Shop product URL.
string
Example
{
"material": {
"ids": [
"7362840009596339971",
"7362840009596339923"
],
"type": "PRODUCT",
"promotion_campaign_schema": "https://www.tiktok.com/t/ZSxRC4FEL/"
},
"campaign_id": "7432840009596339923",
"link_type": "TOKO "
}

Success

Media typeapplication/json
object
code

Status code; 0 means success.

integer format: int64
message

Success or failure message.

string
request_id

Request log ID.

string
data
object
sharing_links

Generated affiliate sharing links for successfully processed materials for the publisher specified in the path.

Array<object>
object
material_id

Material ID.

integer format: int64
sharing_link

This is the product promotion link that agencies can share with collaborated publishers. The publishers can post this link at their will.

string
deep_link

A product promotion deep link that opens the corresponding TikTok Shop product detail page. Agencies can share this link with collaborated creators, and creators can copy/paste it into a web browser (or share it to users). If a user places an order via this link, the resulting e-commerce order will carry these parameter values for tracking.

string
one_link

A product promotion one-link that opens the corresponding TikTok Shop product detail page. Agencies can share this link with collaborated creators, and creators can copy/paste it into a web browser (or share it to users). If a user places an order via this link, the resulting e-commerce order will carry these parameter values for tracking. If the user does not have TikTok installed on their phone, they will be redirected to the app store to install TikTok.

string
failed_materials

The list of materials which failed to generate sharing links for.

Array<object>
object
material_id

Material ID.

string
fail_reason

Fail reason.

string
Example
{
"code": 0,
"data": {
"sharing_links": [
{
"material_id": 7362840009596340000,
"sharing_link": "https://www.tiktok.com/t/AIxvOHlaJoKO",
"deep_link": "snssdk1180://ec/pdp?biz_type=0&enter_method=web&gd_label=click_wap_p_product_detail_t_launch_pop_up_s__e__f__fp__fps_affiliate_links_rf_&h5_start_ts=1768977752558&is_commerce=1&jump_time=1768977752558&mall_extra_info=%7B%22mall_out_source%22%3A%22seo.web_product_detail.out_of_app%22%2C%22mall_landing_page%22%3A%22product_detail%22%2C%22mall_homepage_visited_type%22%3A2%7D&media_source=channelshareh5&need_mall=1&needlaunchlog=1&o_app_code=abcsadaadada&page_name=reflow_pdp&page_name=product_detail&params_url=https%3A%2F%2Fshop-id.tokopedia.com%2Fview%2Fproduct%2F1730831248044885504%3Fchain_key%3D%257B%2522event_id%2522%253A%2522o_event_id%2522%252C%2522k%2522%253A%2522000000000000000007596668298679682828%2522%252C%2522sc%2522%253A%2522OPEN_API%2522%252C%2522t%2522%253A1%257D%26div_media_source%3Daffiliate%26event_id%3Do_event_id%26landing_page_name%3Dproduct_detail%26landpage_form%3Dhalf%26page_name%3Dproduct_detail%26scene%3Dpdp%26share_app_id%3D1180%26sticky_diversion_config%3D%257B%2522merge_action%2522%253A%2522merge%2522%252C%2522data%2522%253A%257B%2522channel%2522%253A%255B%2522benefit_hub%2522%255D%257D%252C%2522is_sticky%2522%253A1%257D%26touch_point_product_id%3D1730831248044885504%26trackParams%3D%257B%2522enter_from_info%2522%253A%2522product_share_outside%2522%252C%2522source_page_type%2522%253A%2522product_share%2522%252C%2522enable_shop_tab_popup%2522%253A1%257D%26utm_source%3Dopen_api&previous_page=deeplink_ug_seo_outside_gg_product_detail_link_web&refer=web&requestParams=%7B%22product_id%22%3A%5B%221730831248044885504%22%5D%7D&scene=pdp&trackParams=%7B%22enter_from_info%22%3A%22product_share_outside%22%2C%22source_page_type%22%3A%22product_share%22%2C%22enable_shop_tab_popup%22%3A1%7D&traffic_diversion_info=%7B%22traffic_out_source%22%3A%22affiliate_links%22%2C%22page_name%22%3A%22product_detail%22%7D&ug_media_source=deeplink_ug_seo_outside_gg_product_detail_link_web&ug_medium=fe_component&utm_source=open_api&wid=7506871187759580673",
"one_link": "https://snssdk1180.onelink.me/BAuo?params_url=https%3A%2F%2Fshop-id.tokopedia.com%2Fview%2Fproduct%2F1730831248044885504%3Fchain_key%3D%257B%2522event_id%2522%253A%2522o_event_id%2522%252C%2522k%2522%253A%2522000000000000000007596668298679682828%2522%252C%2522sc%2522%253A%2522OPEN_API%2522%252C%2522t%2522%253A1%257D%26div_media_source%3Daffiliate%26event_id%3Do_event_id%26landing_page_name%3Dproduct_detail%26landpage_form%3Dhalf%26page_name%3Dproduct_detail%26scene%3Dpdp%26share_app_id%3D1180%26sticky_diversion_config%3D%257B%2522merge_action%2522%253A%2522merge%2522%252C%2522data%2522%253A%257B%2522channel%2522%253A%255B%2522benefit_hub%2522%255D%257D%252C%2522is_sticky%2522%253A1%257D%26touch_point_product_id%3D1730831248044885504%26trackParams%3D%257B%2522enter_from_info%2522%253A%2522product_share_outside%2522%252C%2522source_page_type%2522%253A%2522product_share%2522%252C%2522enable_shop_tab_popup%2522%253A1%257D%26utm_source%3Dopen_api\n"
}
],
"failed_materials": [
{
"material_id": "7362840009596339923",
"fail_reason": "The product was sold out"
}
]
},
"message": "Success",
"request_id": "202203070749000101890810281E8C70B7"
}