-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreceive-message.cs
More file actions
33 lines (28 loc) · 945 Bytes
/
receive-message.cs
File metadata and controls
33 lines (28 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using com.freeclimb;
using com.freeclimb.percl;
using com.freeclimb.webhooks.call;
using System;
using Microsoft.AspNetCore.Mvc;
using com.freeclimb.api;
namespace ReceiveMessage.Controllers {
[Route ("inboundSms")]
[ApiController]
public class FreeClimbController : ControllerBase {
[HttpPost]
public ActionResult smsConnect (CallStatusCallback freeClimbRequest) {
string acctId = getAcctId ();
string apiKey = getApiKey ();
FreeClimbClient client = new FreeClimbClient (acctId, apiKey);
string to = freeClimbRequest.getFrom;
string from = "";
client.getMessagesRequester.create(from, to, "Hello from the C# SDK!");
return Ok();
}
private string getAcctId () {
return System.Environment.GetEnvironmentVariable("ACCOUNT_ID");
}
private string getApiKey () {
return System.Environment.GetEnvironmentVariable("API_KEY");
}
}
}