# Extension management interface

Interface Name Introductions
Add promotional space Support affiliate developers to add promotional spots through the interface
Edit Promotional Area Supports consortium developers to edit promotional site names through an interface
Get a list of promotional spots Support affiliate developers to obtain a list of promotional spots through an interface

# 1. Add promotional space

# Interface Dxplaination

Support affiliate developers to call the interface to add promotional spots

# Request address

POST https://api.weixin.qq.com/union/promoter/promotion/add?access_token=ACCESS_TOKEN

# Request parameters

attribute type Default values Required to fill in Introductions
access_token string yes Interface call credentials
promotionSourceName string yes Extension name (up to 20 words long, name not repeatable)

# POST Example

{
  "promotionSourceName": "推广位名称"
}

# Return value

# Object

The returned JSON packet

attribute type Introductions
errcode number Error code
errmsg string Error message
pid string Extension Bit ID, PID

# Return an example

{
    "errcode": 0,
    "errmsg": "ok",
    "pid": "oUkIc71zinc2mtlfC7K-NfGJxxNE_328751529"
}

# Error code

value Introductions
14005 The number of promotional places reached an upper limit
14007 Replication of promotional site name

# 2. Edit Promotional Area

# Interface Dxplaination

Modify the name of the specified extension

# Request address

POST https://api.weixin.qq.com/union/promoter/promotion/upd?access_token=ACCESS_TOKEN

# Request parameters

attribute type Default values Required to fill in Introductions
access_token string yes Interface call credentials
previousPromotionInfo Object yes
previousPromotionInfo.promotionSourcePid string yes Extension bit PID to be modified
previousPromotionInfo.promotionSourceName string yes Revise the previous name
promotionInfo Object yes
promotionInfo.promotionSourceName string yes Name changed after modification

# POST Example

{
  "previousPromotionInfo": {
    "promotionSourcePid": "oUnIc49z",
    "promotionSourceName": "delete"
  },
  "promotionInfo": {
    "promotionSourceName": "upd after22"
  }
}

# Return value

# Object

The returned JSON packet

attribute type Introductions
errcode number Error code
errmsg string Error message

# 3. Get a list of promotional spots

# Interface Dxplaination

Get a list of promotional spots

# Request address

GET https://api.weixin.qq.com/union/promoter/promotion/list?access_token=ACCESS_TOKEN

# Request parameters

attribute type Default values Required to fill in Introductions
access_token string yes Interface call credentials
start number 0 yes deviation
limit number 20 yes Number of pages per page

# Return value

# Object

The returned JSON packet

attribute type Introductions
errcode number Error code
errmsg string Error message
total number Total number of promotional locations
promotionMaxCnt number Maximum number of promotional spaces allowed to be created
promotionSourceList Array. Extension bit data

Structure of promotionSourceList

attribute type Introductions
promotionSourceName string Promotional site name
promotionSourcePid string Extension Bit ID, PID

# Return an example

{
    "errcode": 0,
    "errmsg": "",
    "promotionSourceList": [
        {
            "promotionSourceName": "23444444444",
            "promotionSourcePid": "oqt8u5MV-nX9iyrzARrq-QFsxI28_648499549",
            "status": "1",
            "pidId": "3457"
        },
        {
            "promotionSourceName": "123",
            "promotionSourcePid": "oqt8u5MV-nX9iyrzARrq-QFsxI28_1515204302",
            "status": "1",
            "pidId": "3452"
        }
    ],
    "total": 91,
    "promotionMaxCnt": 100
}