Creates a new record of Data source if the Data source GUID is left empty. Updates an existing Data source record if the passed identifier matches an existing Data source record.
Request
Request URI
Method | Request URI |
---|---|
POST | https://{company-name}.helloid.com/api/v1/datasource |
Request parameters
Parameter | Description |
---|---|
{company-name} | The company name of the target company |
Request headers
Parameter | Description |
---|---|
Content-Type | Must be set to application/json. |
Sample request body
Static datasource example:
{
"dataSourceGUID": "ab208e79-239d-4c82-640d-08d761239df4",
"type": 2,
"name": "statisch",
"model": [
{
"key": "id",
"type": 0
},
{
"key": "make",
"type": 0
},
{
"key": "model",
"type": 0
},
{
"key": "price",
"type": 0
}
],
"value": [
{
"id": 1,
"make": "Tesla",
"model": "Model S 100kWh performance 450kW aut",
"price": 97400
},
{
"id": 2,
"make": "Ford",
"model": "Mondeo",
"price": 32000
},
{
"id": 3,
"make": "Porsche",
"model": "Boxter",
"price": 72000
}
]
}
Task datasource example:
{
"dataSourceGUID": "b5bae607-84e4-4d22-2e88-08d73c1da2d2",
"type": 3,
"name": "Task datasource",
"model": [
{
"key": "Name",
"type": 0
},
{
"key": "Description",
"type": 0
},
{
"key": "Id",
"type": 0
},
{
"key": "Status",
"type": 0
}
],
"automationTaskGUID": "84a8f04e-0927-40f1-911d-4cc1f3453502",
"input": [
{
"description": "dataSource.arguments.defaultArgumentHint",
"translateDescription": false,
"inputFieldType": 1,
"key": "argument1",
"type": 0,
"options": 0
}
]
}
Native datasource type:
{
"dataSourceGUID": "187e8cb3-59c9-4cc0-977b-554557bfd813",
"type": 1,
"name": "HelloID Groups",
"model": [
{
"key": "source",
"type": 0
},
{
"key": "managedByUserGuid",
"type": 0
},
{
"key": "name",
"type": 0
},
{
"key": "fqgn",
"type": 0
},
{
"key": "groupGUID",
"type": 0
},
{
"key": "immutableId",
"type": 0
},
{
"key": "isDefault",
"type": 0
},
{
"key": "isDeleted",
"type": 0
},
{
"key": "isEnabled",
"type": 0
},
{
"key": "isQrEnabled",
"type": 0
}
],
"nativeType": 1,
"input": [
{
"description": "dataSource.arguments.nameFilterHint",
"translateDescription": true,
"inputFieldType": 1,
"key": "scopeGuid",
"type": 0,
"options": 2
},
{
"description": null,
"translateDescription": false,
"inputFieldType": 1,
"key": "search",
"type": 0,
"options": 0
}
]
}
PowerShell data source:
{
"dataSourceGUID": "33E27650-C69A-46AF-9B61-B0AB3AAE40F7",
"type": 4,
"name": "PowerShell Data Source",
"model": [
{
"key": "source",
"type": 0
},
{
"key": "managedByUserGuid",
"type": 0
}
],
"input": [
{
"inputFieldType": 2,
"key": "a",
"type": 0,
"options": 0,
"predefinedValue": null
}
],
"script": "Write-Output @{source= 'AD'; managedByUserGuid = '809EBB33-884F-4C24-9C08-ED3C39E11BF7'}"
}
Request body parameters
Parameter | Description | Required/Optional | Default value |
---|---|---|---|
{Name} | Name of the Data source. Must be unique. | Required | - |
{dataSourceGUID} | The guid of the Data source that is being updated | Required when updating a Data source | |
{Type} |
One of the following values: 2 : Static data source |
Required | - |
{Model} | A JSON array containing objects that each represent one of the Data source's output properties (see table below) | Required | |
{Value} | A JSON array containing zero or more JSON objects. It represents the records a Static Data source will return | Required for Static Data sources | - |
{AutomationTaskGUID} | A guid referring to the Task associated with this Task Data Source | Required for Task Data sources | - |
{Input} | A JSON array containing objects that each represent a Data Source Input property (see table below) | Required for Task Data sources | - |
{Script} | A string formatted PowerShell script | Required for PowerShell Data sources | - |
Parameters belonging to a Data source input property
Parameter | Description | Required/Optional | Default value |
---|---|---|---|
{Key} | Name of this input property | Required | - |
{InputFieldType} | Type of this input property. Either 1 (for an input property that can be configured for each form element that is linked to this Data source, also known as a Form input property) or 2 (for an input property that has a predefined value, also known as a Predefined input property) | Required | - |
{Options} | Either 0 (for an input field that is not required) or 1 (for one that is) | Required | |
{Description} | The description that will show up when configuring a form field that uses this data source. Only relevant for Form input properties. | Required for Form input properties | |
{PredefinedValue} | The predefined value of this input property. May contain HelloID language such as '{{requester.FirstName}}' | Required for Predefined input properties |
Parameters belonging to a Data source output property
Parameter | Description | Required/Optional | Default value |
---|---|---|---|
{Key} | Name of this output property | Required | - |
{Type} | Type of this output property. Can only be 0. | Required | 0 |