I have a issue with .sts script

Gokulakrishnan M 0 Reputation points
2023-05-09T16:35:12.4133333+00:00

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 
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,974 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,868 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.