首页 > 解决方案 > 使用 API powershell 将 ITGlue 联系人分配给字段

问题描述

我只想使用 API Powershell 将联系人分配给应用程序的字段和另一个字段,但我不知道该怎么做。谁能帮助我?

标签: powershell

解决方案


根据他们的API 文档,没有“应用程序”资源类型。它是自定义资源,还是不同类型对象上的字段?(什么样的?)

尝试从图库(或github 链接)安装 ITGlue 的 PowerShell 包装模块ITGlueAPI

Install-Module ITGlueAPI
Import-Module ITGlueAPI

# Check out all the available commands
Get-Command -Module ITGlueAPI

# initial setup:
Add-ITGlueBaseURI -base_uri 'http://myapi.gateway.example.com'
Add-ITGlueAPIKey -ApiKey 'your-key-here'

# Play around with these kinds of "Get-" commands which exist for each resource type:
# This is a good way to see how the data is formatted, and which fields exist per resource
Get-ITGlueFlexibleAssets 
Get-ITGlueContacts -organization_id 1234 -filter_first_name 'Foo' -sort 'first_name'

# To make changes, run similar "Set-" or "New-" commands with the updates in hash table format:
Set-ITGlueContacts -id 1234 -data @{
    location-id   = 795
    location-name = "San Francisco - HQ"
    field-name    = "Value"
}


推荐阅读