The set product ownership operation will create new product ownership records or update existing ones using the specified request body.
1. Using JSON
Request
Request URI
Method | Request URI |
---|---|
POST | https://{company-name}.helloid.com/api/v1/productownership/ |
POST | https://{company-name}.helloid.com/api/v1/productownership/batch/ |
Request parameters
Parameter | Description |
---|---|
{company-name} | The company name of the target company |
Request headers
Header | Description |
---|---|
Content-Type | Required. Must be set to application/json. |
Sample request body
{
"UserName": "TestUser",
"ProductSKU": "A1234-567-890",
"TimeOfApproval": "22-08-2019",
"Quantity": 2,
"Source": "AD"
}
Sample request body (batch)
[
{
"UserName": "TestUser",
"ProductSKU": "A1234-567-890",
"TimeOfApproval": "22-08-2019",
"HasProduct": true,
"Source": "AD"
},
{
"UserName": "TestUser",
"ProductSKU": "A1234-567-891",
"IncreaseQuantityBy": -1
}
]
Request body parameters
Parameter | Description | Required/Optional | Default value |
---|---|---|---|
{UserName} | Username of the user who owns the product. | Required | - |
{ProductSKU} | SKU of the owned product. | Required | - |
{TimeOfApproval} | When was the product ownership approved. | Optional | - |
{Source} | Indicates the source of the product ownership. | Optional | - |
{Hasproduct} | If true the user has the product, if false the user doesn't. | Optional | false |
{IncreaseQuantityBy} | The amount by which the increment the quantity. | Optional | 1 |
2. Using CSV
Request
Request URI
Method | Request URI |
---|---|
POST | https://{company-name}.helloid.com/api/v1/productownership/csv/ |
Request parameters
Parameter | Description |
---|---|
{company-name} | The company name of the target company |
Request headers
Header | Description |
---|---|
Content-Type | Required. Must be set to text/csv. |
Field order
{UserName},{ProductSKU},{DateOfApproval},{Source},{HasProduct}, {IncreaseQuantityBy}
Sample request body
TestUser,A1234-567-890,03-05-2017,AD,true
TestUser,A1234-567-891,,,false
Response
Response status
Code | Description |
---|---|
200(OK) | Indicates that the operation was successful and the resource is created. |
400(BAD REQUEST) | Indicates that the operation was not successful. There were validation errors or the request body was malformed.If there were validation errors, the response will include a error result. |
401(UNAUTHORIZED) | Indicates that no authentication header was given or the api key and secret were invalid. If the api key and secret were valid check the configuration in your portal, it is possibilty these were IP restricted or are disabled. |
Please also see error result.
Please also see common HTTP status codes.
Sample response body
[
{
"UserName": "TestUser",
"ProductSKU": "A1234-567-890",
"TimeOfApproval": "01-05-2019",
"Source": "AD",
"Quantity": 1
}
]
Example request with cURL
Replace placeholder values surrounded by {
}
with the actual values.
curl -u {api-key}:{api-secret} -X POST https://{company-name}.helloid.com/api/v1/productownership/batch/ -H "Content-Type:application/json" -d
"[
{
'UserName': 'TestUser',
'ProductSKU': 'A1234-567-890'
},
{
'UserName': 'TestUser',
'ProductSKU': 'A1234-567-891'
}
]"