Hey.
I wanted to make an HTTP GET request to the Matrix42 API, to get IDs from our ticket and create a link, when someone sends a TicketNumber in the chat.
I implemented the IPreMessageSentModify interface and try to call the get request with HTTP interface (IHttp) that was provided by the method.
The response I get from the API in rocket.chat is null while the request from Postman or AdvancedRestClient is filled.
The way I try to do the request
const response = await this.http.get(`${this.requestUrl}`, {
params: {
where: `TicketNumber='${ticketId}'`,
columns: requestColumns,
},
headers: {
'Authorization': `Basic ${base64Login}`,
'User-Agent': 'Rocket.Chat-App-Engine',
},
});
On Server-Log I get the following message:
The App a12ee379-93af-4a70-8a2c-78a1c0f5fef9 is requesting from the outter webs: {
appId: 'a12ee379-93af-4a70-8a2c-78a1c0f5fef9',
method: 'get',
url: 'https://servicestore.damp.local/M42Services/api/data/fragments/SPSActivityClassBase',
request: {
params: {
where: "TicketNumber='PRB00002'",
columns: 'TicketNumber,ID,UsedInTypeSPSActivityTypeGroupTicket.ID AS ticketId'
},
headers: {
Authorization: 'Basic YS5hbHBhdHNrb3Y6aDZzbS5ianMxcm5L',
'User-Agent': 'Rocket.Chat-App-Engine'
},
npmRequestOptions: {}
}
}
Has anyone an idea why I get a null response?