Skip to content

CoryBall/ytel.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ytel.NET

A C# SDK for Ytel phone services

NOTE: This is package is currently in development. Until a stable release, it is possible that any updates might include breaking changes.

Current features:

Numbers

  • Retrieving available phone numbers
  • Purchasing a phone number
  • Releasing a phone number
  • Getting phone numbers owned by Ytel account

Voice

  • Make call
  • Make group call
  • InboundXML

Getting Started:

  1. Register a long-lived bearer token and supply it to the SDK in startup

    From your dashboard, navigate to Settings -> API Tokens -> Create Token

    builder.Services.AddYtel(options =>
    {
        options.ApiToken = ytelConfig.ApiToken;
    });
  2. Inject it and use it!

    public class PhoneNumberController : ControllerBase
    {
        private readonly YtelClient _ytelClient;
    
        public PhoneNumberController(YtelClient ytelClient)
        {
            _ytelClient = ytelClient;
        }
    
        [HttpGet("/available")]
        public async Task<ActionResult<YtelApiResponse<GetAvailableNumbersOutput>>> GetAvailablePhoneNumbers(
            [FromQuery] GetAvailableNumbersInput input)
        {
            var phoneNumbers = await _ytelClient.Numbers.GetAvailableNumbersAsync(input);
            return Ok(phoneNumbers);
        }
    }

Development:

To run the solution with the included Ytel.Example.Api project, register your Ytel API token in dotnet secret manager with the name ApiToken

About

C# SDK for Ytel phone services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages