learningtypes
Represents a learnint type REST API structure
GET
URI |
/services/apexrest/v1.0/learningtypes/* |
Description |
Returns learning types with related catalog records based on learning type name or learning type ID, and optionally custom fields of LearningType and Catalog objects that are passed as parameters in request URL |
Input Parameters
ids |
Comma-separated Salesforce record IDs of learning types |
names |
Comma-separated names of learning types, use double quotes for all entries |
vanahcm__learningtype__c |
Comma-separated API names of custom field to be queried for vanahcm__learningtype__c object |
vanahcm__learning_catalog__c |
Comma-separated API names of custom field to be queried for vanahcm__learning_catalog__c object |
Sample Code
// GET Response
[{
"OwnerId": "005j000000BWLAkAAP",
"Name": "Learning Type 1",
"LastModifiedDate": "2016-04-28T17:22:39.000Z",
"LastModifiedById": "005j000000BWLAkAAP",
"Id": "a2xj0000000sdLEAAY",
"CustomFields": [{
"FieldName": "CustomFieldName",
"Value": "CustomFieldValue"
}],
"CreatedDate": "2016-04-28T17:22:39.000Z",
"CreatedById": "005j000000BWLAkAAP"
}]
POST
URI |
/services/apexrest/v1.0/learningtypes/* |
Description |
Insert learning type records with related learning catalog |
Input Parameters
records |
Learning type records that need to be inserted |
Sample Code
// POST Request
{
"records": [{
"Name": "Learning Type",
"LearningCatalogs": [{
"Name": "Learning Catalog 1 for LT1",
"StartDate": "2016-01-03",
"EndDate": "2016-01-05",
"Vendor": "Salesforce",
"Description": "Description",
"VendorLocation": "Test Vendor Location 1.1"
}],
"CustomFields": [{
"FieldName": "CustomField1__c",
"Value": "Test"
}, {
"FieldName": "CustomField2__c",
"Value": 2
}, {
"FieldName": "CustomField3__c",
"Value": "foo@bar.com"
}, {
"FieldName": "CustomField4__c",
"Value": "2015-02-02"
}, {
"FieldName": "CustomField5__c",
"Value": "true"
}]
}]
}
// POST Response
[{
"RecordId": "a2L15000000KI73EAG",
"CatalogIds": ["a2M15000000EQ0sEAG"]
}]
PATCH
URI |
/services/apexrest/v1.0/learningtypes/* |
Description |
Insert or update learning type records with related learning catalog |
Input Parameters
records |
Learning type records that need to be inserted or updated |
Sample Code
// PATCH Request
{
"records": [{
"Id": "a2rj000000198kmAAY",
"Name": "Update Learning Type 1 Name",
"LearningCatalogs": [{
"Name": "Learning Catalog 1 for LT1",
"StartDate": "2016-01-03",
"EndDate": "2016-01-05",
"Vendor": "Salesforce",
"Description": "Description",
"VendorLocation": "Test Vendor Location 1.1"
}],
"CustomFields": [{
"FieldName": "CustomField1__c",
"Value": "Test"
}, {
"FieldName": "CustomField2__c",
"Value": 2
}, {
"FieldName": "CustomField3__c",
"Value": "foo@bar.com"
}, {
"FieldName": "CustomField4__c",
"Value": "2015-02-02"
}, {
"FieldName": "CustomField5__c",
"Value": "true"
}]
}]
}
// PATCH Response
[{
"RecordId": "a2L15000000KI73EAG",
"CatalogIds": ["a2M15000000EQ0sEAG"]
}]
|