2017-05-09 36 views
2

我有問題標記在通過Zapier Intercom的領先。 Zapier提供了一個「標籤用戶」操作,但沒有提供任何線索。由於內部通信要求導線根據其ID(而不是電子郵件)進行標記,因此不能使用現有的Zapier操作。添加標籤,以引導對講與Zapier

回答

1

這裏是我的解決方案:

fetch('https://api.intercom.io/tags', { 
    method: 'POST', 
    headers: { 
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 
    'Accept': 'application/json', 
    'Content-Type': 'application/json' 
    }, 
    body: JSON.stringify({ 
    name: 'YOUR TAG NAME', 
    user: [{ id: input.leadId }] 
    }) 
}) 
.then(function(res) { 
    callback(null, JSON.parse(res.text())); 
}) 
.catch(callback);