Need aid in "concept" of using API w/curl

8 views
Skip to first unread message

Brian_techguy

unread,
Jan 4, 2009, 4:57:29 PM1/4/09
to PBwiki API Hackers
All: I do technical support for a living, but do know basic Java and
some VB.Net. So I'm not really a developer, but understand development
in general. However, I can't quite get the "lay of the land" on using
the PBWiki API. I'd like to drive it via curl and use it to upload a
file and download a file (via a script) on my wiki: http://bennbrian.pbwiki.com.
I've visited the documentation, but just don't "get it" yet: I have
been able to successfully use curl to retrieve data, but am stuck on
uploading. My wiki is API-enabled.

The post in this group titled 'putfile doesn't works for me' shows an
example:

curl -s http://m3labs.pbwiki.com/api_v2/ -d
"op=PutFile&admin_key=xxxxxxxxxxxxx&data=some+text&filename=somefile"

I've tried tailoring this for my site:
curl -s http://bennbrian.pbwiki.com/api_v2 -d
"op=PutFile&admin_key=xxxxxx&data=sometext&filename=curl.txt"
(Note: I've xxx'ed out my admin key)
I get no response and an errorlevel=0 (WinXP Pro system) and there is
a file named curl.txt in the current folder. However, I don't see this
on my wiki site when I look under the Upload Files section.

I would appreciate any guidance you could give to a newbie!

Thanks!

Mark Christian

unread,
Jan 12, 2009, 4:16:14 PM1/12/09
to benn...@gmail.com, PBwiki API Hackers
Hi Brian;
Unfortunately, the API call you chose to start off with is a bit
incomplete at this time. I'm sorry the documentation doesn't reflect
that better — it's definitely all a work in progress at this point.

You can PutFile on your wiki, but you have to use standard HTTP file
uploads — the 'data' method isn't operational (yet). So, with curl,
you'd include "--upload-file <filename>".

— Mark
Reply all
Reply to author
Forward
0 new messages