How to get all order history from Bitmex

can someone please show me how to download the entire order history from PHP using the Bitmex API? I can't connect.