.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Socialtext::Resting 3pm" .TH Socialtext::Resting 3pm "2012-04-23" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Socialtext::Resting \- module for accessing Socialtext REST APIs .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 9 \& use Socialtext::Resting; \& my $Rester = Socialtext::Resting\->new( \& username => $opts{username}, \& password => $opts{password}, \& server => $opts{server}, \& ); \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_page(\*(Aqmy_page\*(Aq); \&} .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Socialtext::Resting\*(C'\fR is a module designed to allow remote access to the Socialtext \s-1REST\s0 APIs for use in perl programs. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 5 \& my $Rester = Socialtext::Resting\->new( \& username => $opts{username}, \& password => $opts{password}, \& server => $opts{server}, \& ); \& \& or \& \& my $Rester = Socialtext::Resting\->new( \& user_cookie => $opts{user_cookie}, \& server => $opts{server}, \& ); .Ve .PP Creates a Socialtext::Resting object for the specified server/user/password, or server/cookie combination. .SS "accept" .IX Subsection "accept" .Vb 1 \& $Rester\->accept($mime_type); .Ve .PP Sets the \s-1HTTP\s0 Accept header to ask the server for a specific representation in future requests. .PP Standard representations: http://www.socialtext.net/st\-rest\-docs/index.cgi?standard_representations .PP Common representations: .IP "text/x.socialtext\-wiki" 4 .IX Item "text/x.socialtext-wiki" .PD 0 .IP "text/html" 4 .IX Item "text/html" .IP "application/json" 4 .IX Item "application/json" .PD .SS "get_page" .IX Subsection "get_page" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_page(\*(Aqpage_name\*(Aq); .Ve .PP Retrieves the content of the specified page. Note that the workspace method needs to be called first to specify which workspace to operate on. .SS "get_page_revision" .IX Subsection "get_page_revision" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_page_revision(\*(Aqpage_name\*(Aq, \*(Aqrevision_id\*(Aq); .Ve .PP Retrieves the content of the specified page revision. Note that the workspace method needs to be called first to specify which workspace to operate on. .SS "get_attachment" .IX Subsection "get_attachment" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_attachment(\*(Aqattachment_id\*(Aq); .Ve .PP Retrieves the specified attachment from the workspace. Note that the workspace method needs to be called first to specify which workspace to operate on. .SS "put_workspacetag" .IX Subsection "put_workspacetag" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->put_workspacetag(\*(Aqtag\*(Aq); .Ve .PP Add the specified tag to the workspace. .SS "put_pagetag" .IX Subsection "put_pagetag" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->put_pagetag(\*(Aqpage_name\*(Aq, \*(Aqtag\*(Aq); .Ve .PP Add the specified tag to the page. .SS "delete_workspacetag" .IX Subsection "delete_workspacetag" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->delete_workspacetag(\*(Aqtag\*(Aq); .Ve .PP Delete the specified tag from the workspace. .SS "delete_pagetag" .IX Subsection "delete_pagetag" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->delete_pagetag(\*(Aqpage_name\*(Aq, \*(Aqtag\*(Aq); .Ve .PP Delete the specified tag from the page. .SS "post_attachment" .IX Subsection "post_attachment" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->post_attachment(\*(Aqpage_name\*(Aq,$id,$content,$mime_type); .Ve .PP Attach the file to the specified page .SS "post_comment" .IX Subsection "post_comment" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->post_comment( \*(Aqpage_name\*(Aq, "me too" ); .Ve .PP Add a comment to a page. .SS "put_page" .IX Subsection "put_page" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->put_page(\*(Aqpage_name\*(Aq,$content); .Ve .PP Save the content as a page in the wiki. \f(CW$content\fR can either be a string, which is treated as wikitext, or a hash with the following keys: .IP "content" 4 .IX Item "content" A string which is the page's wiki content. .IP "date" 4 .IX Item "date" \&\s-1RFC\s0 2616 \s-1HTTP\s0 Date format string of the time the page was last edited .IP "from" 4 .IX Item "from" A username of the last editor of the page. If the the user does not exist it will be created, but will not be added to the workspace. .SS "delete_page" .IX Subsection "delete_page" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->delete_page(\*(Aqpage_name\*(Aq); .Ve .PP Delete the specified page. .SS "name_to_id" .IX Subsection "name_to_id" .Vb 2 \& my $id = $Rester\->name_to_id($name); \& my $id = Socialtext::Resting::name_to_id($name); .Ve .PP Convert a page name into a page \s-1ID\s0. Can be called as a method or as a function. .SS "get_pages" .IX Subsection "get_pages" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_pages(); .Ve .PP List all pages in the wiki. .SS "get_page_attachments" .IX Subsection "get_page_attachments" .Vb 1 \& $Rester\->get_page_attachments($page) .Ve .PP List all the attachments on a page. .SS "get_sheet_cell" .IX Subsection "get_sheet_cell" .Vb 1 \& $Rester\->get_sheet_cell($page_id, $cellid) .Ve .PP Get the value of a cell in a spreadsheet. .SS "get_revisions" .IX Subsection "get_revisions" .Vb 1 \& $Rester\->get_revisions($page) .Ve .PP List all the revisions of a page. .SS "get_taghistory" .IX Subsection "get_taghistory" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_taghistory($page) .Ve .PP Get a history, by revision, of all tags for a page. .SS "get_workspace_tags" .IX Subsection "get_workspace_tags" .Vb 2 \& $Rester\->workspace(\*(Aqfoo\*(Aq); \& $Rester\->get_workspace_tags() .Ve .PP List all the tags in workspace foo. .SS "get_homepage" .IX Subsection "get_homepage" Return the page name of the homepage of the current workspace. .SS "get_backlinks" .IX Subsection "get_backlinks" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_backlinks(\*(Aqpage_name\*(Aq); .Ve .PP List all backlinks to the specified page .SS "get_frontlinks" .IX Subsection "get_frontlinks" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_frontlinks(\*(Aqpage_name\*(Aq); .Ve .PP List all 'frontlinks' on the specified page .SS "get_pagetags" .IX Subsection "get_pagetags" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_pagetags(\*(Aqpage_name\*(Aq); .Ve .PP List all pagetags on the specified page .SS "get_taggedpages" .IX Subsection "get_taggedpages" .Vb 2 \& $Rester\->worksapce(\*(Aqwikiname\*(Aq); \& $Rester\->get_taggedpages(\*(Aqtag\*(Aq); .Ve .PP List all the pages that are tagged with 'tag'. .SS "get_tag" .IX Subsection "get_tag" .Vb 2 \& $Rester\->workspace(\*(Aqwikiname\*(Aq); \& $Rester\->get_tag(\*(Aqtag\*(Aq); .Ve .PP Retrieves the specified tag from the workspace. Note that the workspace method needs to be called first to specify which workspace to operate on. .SS "get_breadcrumbs" .IX Subsection "get_breadcrumbs" .Vb 1 \& $Rester\->get_breadcrumbs(\*(Aqworkspace\*(Aq) .Ve .PP Get breadcrumbs for current user in this workspace .SS "get_workspace" .IX Subsection "get_workspace" .Vb 1 \& $Rester\->get_workspace(); .Ve .PP Return the metadata about a particular workspace. .SS "get_workspaces" .IX Subsection "get_workspaces" .Vb 1 \& $Rester\->get_workspaces(); .Ve .PP List all workspaces on the server .SS "get_user" .IX Subsection "get_user" .Vb 2 \& my $userinfo = $Rester\->get_user($username); \& print $userinfo\->{email_address}; .Ve .PP Get information about a username .SS "create_user" .IX Subsection "create_user" .Vb 3 \& $Rester\->create_user( { username => $username, \& email_address => $email, \& password => $password } ); .Ve .PP Create a new user. Other parameters can be specified, see \s-1POD\s0 for Socialtext::User. username is optional and will default to the email address, as in most cases username and email_address will be the same. .SS "add_user_to_workspace" .IX Subsection "add_user_to_workspace" .Vb 4 \& $Rester\->add_user_to_workspace( $workspace, { username => $user, \& rolename => $role, \& send_confirmation_invitation => 0 || 1, \& from_address => $from_email } ); .Ve .PP Add a user that already exists to a workspace. rolename defaults to 'member', send_confirmation_invitation defaults to '0'. from_address must refer to a valid existing user, and is only needed if send_confirmation_invitation is set to '1'. If the user is already a member of the workspace, this will reset their role if you specify a role that's different from their current role. .SS "get_users_for_workspace" .IX Subsection "get_users_for_workspace" .Vb 2 \& my @users = $Rester\->get_users_for_workspace( $workspace ); \& for ( @users ) { print "$_\->{name}, $_\->{role}, $\->{is_workspace_admin}\en" } .Ve .PP Get a list of users in a workspace, and their roles and admin status. .SS "put_persontag" .IX Subsection "put_persontag" .Vb 1 \& $Rester\->put_persontag( $person, $tag ) .Ve .PP Tag a person. .SS "get_persontags" .IX Subsection "get_persontags" .Vb 1 \& $Rester\->get_persontags($person); .Ve .PP Retrieves all tags for a person .SS "get_people" .IX Subsection "get_people" .Vb 1 \& $Rester\->get_people(); .Ve .PP Retrieves all people. .SS "get_person" .IX Subsection "get_person" .Vb 1 \& $Rester\->get_person(); .Ve .PP Retrieves a person. .SS "get_signals" .IX Subsection "get_signals" .Vb 3 \& $Rester\->get_signals(); \& $Rester\->get_signals(group_id => 42); \& $Rester\->get_signals(account_id => 2); .Ve .PP Retrieves the list of signals. .PP Optional arguments are passed as query paramaters. .SS "post_signal" .IX Subsection "post_signal" .Vb 6 \& $Rester\->post_signal(\*(AqO HAI\*(Aq); \& $Rester\->post_signal(\*(AqO HAI\*(Aq, group_id => 42); \& $Rester\->post_signal(\*(AqO HAI\*(Aq, group_ids => [2,3,4]); \& $Rester\->post_signal(\*(AqO HAI\*(Aq, account_id => 42); \& $Rester\->post_signal(\*(AqO HAI\*(Aq, account_ids => [2,3,4]); \& $Rester\->post_signal(\*(AqO HAI\*(Aq, in_reply_to => { signal_id => 142 }); .Ve .PP Posts a signal. .PP Optional \f(CW\*(C`account_ids\*(C'\fR and \f(CW\*(C`group_ids\*(C'\fR arguments for targeting the signal. .PP Optional \f(CW\*(C`in_reply_to_id\*(C'\fR for specifying a signal_id this signal is in reply to. .PP Optional \f(CW\*(C`annotations\*(C'\fR to annotate the signal. \f(CW\*(C`annotations\*(C'\fR should be an array ref containing hashrefs that have one key (the annotation type) and a value that is a hashref containing key/value pairs. .SS "post_webhook" .IX Subsection "post_webhook" .Vb 1 \& $Rester\->post_webhook( %args ) .Ve .PP Creates a webhook. Args will be encoded as \s-1JSON\s0 and put up. .SS "get_webhooks" .IX Subsection "get_webhooks" .Vb 1 \& my $hooks = $Rester\->get_webhooks(); .Ve .PP Returns an arrayref containing hashrefs of each webhook on the server. .SS "delete_webhook" .IX Subsection "delete_webhook" .Vb 1 \& $Rester\->delete_webhook( id => $webhook_id ); .Ve .PP Deletes the specified webhook. .SS "response" .IX Subsection "response" .Vb 1 \& my $resp = $Rester\->response; .Ve .PP Return the HTTP::Response object from the last request. .SH "AUTHORS / MAINTAINERS" .IX Header "AUTHORS / MAINTAINERS" Shawn Devlin \f(CW\*(C`\*(C'\fR .PP Kevin Jones \f(CW\*(C`\*(C'\fR .PP Brandon Noard \f(CW\*(C`\*(C'\fR .SS "\s-1CONTRIBUTORS\s0" .IX Subsection "CONTRIBUTORS" Luke Closs .PP Jeremy Stashewsky .PP Chris Dent .PP Kirsten Jones .PP Michele Berg \- \fIget_revisions()\fR