Skip to content

slideroom/api-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlideRoom API for C#

Example

using System;
using System.IO;
using SlideRoom.API;

namespace TestApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            var client = new SlideRoomClient("api hash key", "api access key", "email address", "organization code");

            var requestRes = client.Export.Request("export name", SlideRoom.API.Resources.RequestFormat.Txt);
            PrintExport(client, requestRes.Token);
            Console.ReadLine();
        }

        static void PrintExport(SlideRoomClient client, int token)
        {
            bool pending = true;
            while (pending == true)
            {
                var downloadRes = client.Export.Download(token);
                pending = downloadRes.Pending;
                if (pending == false)
                {
                    var responseText = String.Empty;
                    using (var reader = new StreamReader(downloadRes.ExportStream))
                    {
                        responseText = reader.ReadToEnd();
                    }

                    Console.Write(responseText);
                    break;
                }

                // wait 10 seconds before trying again
                System.Threading.Thread.Sleep(TimeSpan.FromSeconds(10));
            }
        }
    }
}

Install From NuGet

PM> Install-Package SlideRoom

About

SlideRoom API Wrapper for C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages