Some examples of how to use the client.
Make sure you've enabled the Developer flag in your TGC account and requested an API key. Then you can authenticate like this:
my $session = tgc_post('session', { username => 'me', password => '123qwe', api_key_id => 'abcdefghijklmnopqrztuz', });
If you want to create a file you can do that pretty easily. First you'll need a folder ID to attach it to. You can get your home folder ID like this:
my $user = tgc_get('user', { session_id => $session->{id}, }); my $home_folder_id = $user->{root_folder_id};
Now you're ready to upload.
my $file = tgc_post('file', { session_id => $session->{id}, file => ['/path/to/file.jpg'], name => 'file.jpg', folder_id => $home_folder_id, });
To install TheGameCrafter::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm TheGameCrafter::Client
CPAN shell
perl -MCPAN -e shell install TheGameCrafter::Client
For more information on module installation, please visit the detailed CPAN module installation guide.