Click for Xamarin.Android Version
Integrate Multiple Services With Just One API
CloudRail is an API integration solution which abstracts multiple APIs from different providers into a single and universal interface.
Current Interfaces:
---Full documentation can be found at our website.
Learn more about CloudRail on https://cloudrail.com
With CloudRail, you can easily integrate external APIs into your application. CloudRail provides abstracted interfaces that take several services and then exposes a developer-friendly API that uses common functions between all providers. This means that, for example, Upload() works in exactly the same way for Dropbox as it does for Google Drive, OneDrive, and other Cloud Storage Services, and GetEmail() works similarly the same way across all social networks.
You can download CloudRail SDK Nuget Package from: https://www.nuget.org/packages/Xamarin.CloudRail.iOS
Or just download and add the DLL cloudrail-si-xamarin-ios-sdk.dll
file to your project reference.
In the Project Navigator, open the source file of your application delegate. Add the import statement at the top of the file, then add the following call to CloudRail in the didFinishLaunching or didFinishLaunchingWithOptions method of your app delegate:
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
Interface | Included Services |
---|---|
Cloud Storage | Dropbox, Google Drive, OneDrive, Box, pCloud, Egnyte, OneDrive Business |
Business Cloud Storage | Amazon S3, Microsoft Azure, Rackspace, Backblaze |
Social Profiles | Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Instagram, Heroku |
Social Interaction | Facebook, Twitter |
Payment | PayPal, Stripe |
Maljet, Sendgrid, Gmail | |
SMS | Twilio, Nexmo |
Point of Interest | Google Places, Foursquare, Yelp |
Video | Youtube, Twitch, Vimeo |
Messaging | Facebook Messenger, Telegram, Line, Viber, SlackBot |
- Dropbox
- Box
- Google Drive
- Microsoft OneDrive
- pCloud
- Egnyte
- OneDrive Business
- Download files from Cloud Storage.
- Upload files to Cloud Storage.
- Upload files with modified date to Cloud Storage.
- Get Meta Data of files, folders and perform all standard operations (copy, move, etc) with them.
- Retrieve user and quota information.
- Generate share links for files and folders.
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRCloudStorageProtocol> service;
// Setup Google Drive Authenticating: https://blog.cloudrail.com/authenticating-google-drive/
// CRGoogleDrive drive = new CRGoogleDrive("[clientIdentifier]", "", "[redirectUri]", "[state]");
// drive.UseAdvancedAuthentication();
// service = drive;
// service = new CRBox("[clientIdentifier]", "[clientSecret]");
// service = new CROneDrive("[clientIdentifier]", "[clientSecret]");
// service = new CRPCloud("[clientIdentifier]", "[clientSecret]");
//Setup Dropbox Authenticating: https://blog.cloudrail.com/authenticating-with-dropbox/
CRDropbox dropbox = new CRDropbox("[clientIdentifier]", "[clientSecret]", "https://auth.cloudrail.com/YourBundleID", "someState");
dropbox.UseAdvancedAuthentication();
service = dropbox;
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
NSInputStream object = service.DownloadFileWithPath:@"/mudkip.jpg"];
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
//READ FROM STREAM
- Amazon Web Services S3
- Microsoft Azure
- Rackspace
- Backblaze
- Create, delete and list buckets
- Upload files
- Download files
- List files in a bucket and delete files
- List files in a with prefix
- Get file metadata (last modified, size, etc.)
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRBusinessCloudStorageProtocol service;
// service = new CRMicrosoftAzure("[accountName]", "[accessKey]");
// service = new CRRackspace("[username]", "[apiKey]", "[region]");
// service = new CRBackblaze("[accountId]", "[appKey]");
// service = new CRGoogleCloudPlatform("[clientEmail]", "[privateKey]", "[projectId]");
service = new AmazonS3("[accessKeyId]", "[secretAccessKey]", "[region]");
CRBucket bucket = new CRBucket();
bucket.Name = "bucket_name";
bucket.Identifier = "bucket_id";
NSData data = //data source;
var len = (int)data.Length
NSInputStream inputStream = new NSInputStream(data)
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
service.UploadFileToBucket(bucket,"file_name",inputStream,len);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- Github
- Google Plus
- Slack
- Windows Live
- Yahoo
- Heroku
- Get profile information, including full names, emails, genders, date of birth, and locales.
- Retrieve profile pictures.
- Login using the Social Network.
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRProfileProtocol service;
// Google Plus:
// CRGooglePlus gPlus = new CRGooglePlus("[clientIdentifier]", "", "[redirectUri]", "[state]");
// gPlus.UseAdvancedAuthentication();
// service = gPlus;
// service = new CRGitHub("[clientIdentifier]", "[clientSecret]");
// service = new CRSlack("[clientIdentifier]", "[clientSecret]");
// service = new CRInstagram("[clientIdentifier]", "[clientSecret]");
// ...
service = new CRFacebook("[clientIdentifier]", "[clientSecret]");
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
string email = service.GetEmail();
string fullname = service.GetFullName();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- Get a list of connections.
- Make a post for the user.
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRSocialProtocol service;
// service = new CRTwitter("[clientID]", "[clientSecret]");
// service = new CRFacebook("[pageName]", "[clientID]", "[clientSecret]");
service = new CRFacebook("[clientID]", "[clientSecret]");
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
service.PostUpdateWithContent("Using Cloudrail sdk!");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- PayPal
- Stripe
- Perform charges
- Refund previously made charges
- Manage subscriptions
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRPaymentProtocol service;
// service = new CRPayPal(true, "[clientIdentifier]", "[clientSecret]");
service = new CRStripe("[secretKey]");
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
CRSubscriptionPlan subPlan = service.CreateSubscriptionPlanWithName("Plan name",2000,"USD","description","day",7);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- Mailjet
- Sendgrid
- Gmail
- Send Email
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICREmailProtocol service;
// service = new CRMailJet("[clientIdentifier]", "[clientSecret]");
// service = new CRGMail("[GMail Client Identifier]","","com.cloudrail.example:/auth","someState");
service = new CRSendGrid("API Key");
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
NSMutableArray<NSString> toAddresses = new NSMutableArray<NSString>();
toAddresses.Add(new NSString("[email protected]"));
toAddresses.Add(new NSString("[email protected]"));
CRAttachment attachImage = new CRAttachment(content,"image/jpg","MyFile.jpg"); //InputStream, MimeType,FileName
NSMutableArray<CRAttachment> attachments = new NSMutableArray<CRAttachment>();
attachments.Add(attachImage);
service.SendEmail("[email protected]", @"Bob", toAddresses, "Mailjet and SendGrid", "The Mailjet and Sendgrid is on cloudrail now!!!","", null, null, attachments);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- Twilio
- Nexmo
- Twizo
- Send SMS
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRSMSProtocol service;
// service = new CRNexmo("[clientIdentifier]", "[clientSecret]");
service = new CRTwilio("[clientIdentifier]", "[clientSecret]");
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
service.SendSMS("CloudRail", "+4912345678", "Hello from CloudRail");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- Google Places
- Foursquare
- Yelp
- Get a list of POIs nearby
- Filter by categories or search term
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRPointsOfInterestProtocol service;
// service = new CRYelp("[consumerKey]", "[consumerSecret]", "[token]", "[tokenSecret]");
// service = new CRGooglePlaces("[apiKey]");
service = new CRFoursquare("[clientID]", "[clientSecret]");
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
NSMutableArray arrayPOI = service.NearbyPoisWithLatitude(9.483927, 8.473272, 300, "", null);
CRPOI[] pois = NSArray.FromArray<CRPOI>(arrayPOI);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- Youtube
- Twitch
- Vimeo
- Search for videos
- Upload videos
- Get a list of videos for a channel
- Get channel details
- Get your own channel details
- Get video details
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRVideoProtocol service;
// service = new CRTwitch("[Twitch Client Identifier]", "[Twitch Client Secret]");
// service = new CRVimeo("[Vimeo Client Identifier]", "[Vimeo Client Secret]");
service = new CRYouTube("[YouTube Client Identifier]", "", "com.cloudrail.example:/auth", "someState");
service.UseAdvancedAuthentication();
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
CRVideoMetaData[] result = NSArray.FromArray<CRVideoMetaData>(service.SearchVideosWithQuery("Game of Thrones",0,20)); //Query, Offset, Limit
//CRVideoMetaData result = service.UploadVideoWithTitle("HowTo: Setup CloudRail","Video about Setting up CloudRail", NSInputStream, 1448576, "UCnrFDdA2KAItbRzm2a3I_OA", "video/mp4"); // Title, Description, Stream (data), Size, ChannelID (optional for Youtube) and Video Mime type
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
- FacebookMessenger
- Telegram
- Line
- Viber
- Send text messages
- Send files, images, videos and audios
- Parse a message received on your webhook
- Download the content of an attachment sent to your webhook
using CloudRailSI;
CRCloudRail.AppKey = "{Your_License_Key}";
ICRMessagingProtocol service;
// service = new CRViber("[Bot Token]", "[Webhook URL]", "[Bot Name]");
// service = new CRTelegram("[Bot Token]", "[Webhook URL]");
// service = new CRLine("[Bot Token]");
service = = new CRFacebookMessenger("[Bot Token]");
new System.Threading.Thread(new System.Threading.ThreadStart(() =>
{
try
{
CRMessage result = service.SendMessageWithReceiverId("12123242","It's so easy to send message via CloudRail");
Console.WriteLine(result);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
})).Start();
//GET METHOD
CRAdvancedRequestSpecification req = new CRAdvancedRequestSpecification("/people/~:(positions,public-profile-url)?format=json");
req.Method = @"GET";
req.Headers = new Foundation.NSMutableDictionary();;
req.SetBodyAsString("");
CRAdvancedRequestResponse res = service.AdvancedRequestWithSpecification(req);
Console.WriteLine(res.BodyAsString);
More interfaces are coming soon.
-
Consistent Interfaces: As functions work the same across all services, you can perform tasks between services simply.
-
Easy Authentication: CloudRail includes easy ways to authenticate, to remove one of the biggest hassles of coding for external APIs.
-
Switch services instantly: One line of code is needed to set up the service you are using. Changing which service is as simple as changing the name to the one you wish to use.
-
Simple Documentation: There is no searching around Stack Overflow for the answer. The CloudRail documentation at https://cloudrail.com/integrations is regularly updated, clean, and simple to use.
-
No Maintenance Times: The CloudRail Libraries are updated when a provider changes their API.
-
Direct Data: Everything happens directly in the Library. No data ever passes a CloudRail server.
If you don't know how to start or just want to have a look at how to use our SDK in a real use case, we created a few sample application which you can try out:
- Sample using the CloudStorage interface: UnifiedCloudStorage
CloudRail provides a developer portal which offers usage insights for the SDKs and allows you to generate license keys.
It's easy to sign up and generate a key.
Head over to https://cloudrail.com/signup
Learn more about our pricing on https://cloudrail.com/pricing
CloudRail is also available for other platforms like iOS, Java and NodeJS. You can find all libraries on https://cloudrail.com
Get in touch at any time by emailing us: [email protected]
or
Tag a question with cloudrail on StackOverflow