When using SuiteTalk REST Web Services API, Id of ...
# ask-stanley-ai
t
When using SuiteTalk REST Web Services API, Id of the record created is returning in header, Is there a way to get ID of record created in the Body of response?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it appears that the ID of the record created using SuiteTalk REST Web Services API is not returned in the body of the response. The ID is returned in the header of the response. However, there is a workaround to get the internal ID of a record type in SuiteScript if you already have the script ID. Here is a code snippet that was shared:
Copy code
javascript
var customRecordUrl = url.resolveRecord({recordType: 'customrecord_xyz'});
var customRecordId = getRecordTypeId(customRecordUrl);
function getRecordTypeId(recordUrl){
    var startIdx = recordUrl.indexOf('rectype=');
    var paramStr = recordUrl.substring(startIdx, recordUrl.length);
    return paramStr.substring(8, paramStr.indexOf('&'));
}
This code snippet parses the resolved record URL to get the internal ID of the record type. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845207334
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81849122
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.815467656
Please provide your feedback on this answer.