I have a issue with .sts script
I have written a .sts script file and I have defined a function there. I have provided the code below.
Here I am sending a WEBGET request to the endpoint to obtain the PSTN Calls between two dates. I will be getting the app id, tenant id and secret id from the form in frontend and I will storing here in variables.
After checking the response variable here it is empty. To confirm whether the request is sent properly I have checked it with requestcatcher.com there the request was received sucessfully and the response variable was containing the message request caught.
But when I send request to this endpoint the response variable is empty. I have checked by printing the endpoint after construction and I have test the endpoint and accesstoken in postman. It gave a success response with records. It didnt work here. I dont know where I am missing.
I didn't find documentation for .sts script anywhere on internet. please help me and provide me if there is any documentation links.
Response for the endpoint:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.callRecords.pstnCallLogRow)",
"@odata.count": 0,
"value": []
}
**
Script (STS):**
#! Parameter=AppID=APPID==False=
#! Parameter=SecretID
#! Parameter=TenantID
#! Parameter=startDate=STARTDATE==False=
#! Parameter=endDate=ENDDATE==False=
##########################################################################
# Get-GetPstnCalls - Getting GetPstnCalls
##########################################################################
LABEL GetPstnCalls
INSERTEVENT 0 "MSTeams_1.STS" "GetPstnCalls"
# Construct the endpoint URL with the provided dates
SET endpoint = "https://graph.microsoft.com/v1.0/communications/callRecords/getPstnCalls(fromDateTime=" startDate ",toDateTime=" endDate ")"
PRINTLN endpoint
# Set the headers with the access token
SET headers = "Authorization: Bearer " token
PRINTLN headers
# Define an empty response variable
SET response = ""
# Make the GET request
WEBGET endpoint headers response
# Print the response
PRINTLN response
RETURN