help with writing API please

for pastebin.com this is the API info:

They also give this PHP example

can someone help me use all this to write an applescript…or how to use the PHP script in applescript?
Thanks in advance