CreatePage with template bug?

7 views
Skip to first unread message

gordong

unread,
Aug 21, 2011, 7:47:29 PM8/21/11
to PBworks API
Hey folks, I'm having pretty good success with much of the API, but
have come across what must be a bug:

the documentation for CreatePage states that an optional parameter is
a template Name.

I have a page "Activity1" tagged as template, but when I execute
CreateTemplate it throws back an error that the template is not found.
(Activity1 is available in the template drop-down menu when creating a
new page using the pages and files interface)

The command work if I omit the template parameter

Here's my sample call:

http://gordongraber.pbworks.com/api_v2/op/CreatePage/page/testhome/template/Activity1/_type/text/admin_key/xxxxxxxxx

(I've x'd out my admin key above, lest you think I am actually passing
x's! )

returns:

array (
'_auth_role' => 'admin',
'_auth_via' => 'api_key',
'_perm_cache_times' =>
array (
'pagetime' => 1313968130,
),
'_request_id' => '56093',
'_valid_as_of' => 1313969415,
'error_status' => 404,
'error_string' => 'Template not found',
'reference' => 'http://gordongraber.pbworks.com/api_v2/op/DescribeOp/
desc/CreatePage',
'success' => false,
)

Thanks for any ideas!

Eileen Xie

unread,
Aug 22, 2011, 8:01:40 PM8/22/11
to PBworks API
Sorry, this is poor documentation on our part. To use a template from
your own workspace, you need to add "wiki." to the beginning of the
template name. For example, your call would become:

http://gordongraber.pbworks.com/api_v2/op/CreatePage/page/testhome/template/wiki.Activity1/_type/text/admin_key/xxxxxxxxx

If it does not begin with "wiki.", that means we'll look for a
template with that name from our default collection. Our default
template collection includes pages like Course, Syllabus, and
Assignments.

I've also made a change in our documentation to clarify this. The
documentation change will go live tomorrow at 5 PM Pacific:

https://secure.pbworks.com/api_v2/?q=CreatePage

- Eileen Xie

On Aug 21, 4:47 pm, gordong <graber.gor...@gmail.com> wrote:
> Hey folks, I'm having pretty good success with much of the API, but
> have come across what must be a bug:
>
> the documentation for CreatePage states that an optional parameter is
> a template Name.
>
> I have a page "Activity1" tagged as template, but when I execute
> CreateTemplate it throws back an error that the template is not found.
> (Activity1 is available in the template drop-down menu when creating a
> new page using the pages and files interface)
>
> The command work if I omit the template parameter
>
> Here's my sample call:
>
> http://gordongraber.pbworks.com/api_v2/op/CreatePage/page/testhome/te...

gordong

unread,
Aug 25, 2011, 7:22:46 PM8/25/11
to PBworks API
thank you, Eileen! Works perfectly now!
Reply all
Reply to author
Forward
0 new messages