Thread:Project:Support desk/How to use the API in an extension (PHP, not Javascript)/reply

See API:Calling internally. Does that give you enough guidance?