This repo contains a .NET middleware to simplify the usage of the SAM API.
Binaries are available in the bin folder (see SAM.dll).
Up to date API Documentation can be found here.
Every resource is accessed via a SamClient instance:
SamClient client = new SamClient(AuthType.API_KEY, "<API_KEY>");
// Account account = client.RetrieveAccount();
In order to use the SAM API, you must provide the SamClient instance with an API key. There are 3 ways to do this:
- Pass it in the constructor:
SamClient client = new SamClient(AuthType.API_KEY, "<API_KEY>");
- Call setAuth on an existing SamClient instance:
SamClient client = new SamClient();
client.setAuth(AuthType.API_KEY, "<API_KEY>");
- Pass a SamAuth object as the auth parameter to a request method:
SamClient client = new SamClient();
client.RetrieveAccount(new SamAuth(AuthType.API_KEY, "<API_KEY>"));
- Account
RetrieveAccount([auth])
ListAccountUsers([auth])
- Assets
ListAssets(storyId[, parameters, auth])
RetrieveAsset(storyId, assetId[, parameters, auth])
CreateAsset(storyId, parameters[, auth])
- Stories
ListStories([parameters, auth])
RetrieveStory(storyId[, parameters, auth])
CreateStory(parameters[, auth])
DeleteStory(storyId[, auth])
- Upload
UploadMedia(bytes, mimetype[, name, auth])
StartUpload(parameters[, auth])
AppendUpload(parameters[, auth])
CompleteUpload(mediaId[, auth])
- User
RetrieveUser([auth])
Officially maintained by SAM.