Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- url='https://monetizemore.api-us1.com';
- api_key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
- ch=curl_init();
- curl_setopt($ch, CURLOPT_URL, $url."/api/3/contacts");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Api-Token: ".$api_key));
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
- $output=curl_exec($ch);
- curl_close($ch);
- $result=json_decode($output, true);
- echo "result meta total: <br />" . $result["meta"]["total"] . "<br />";
- echo "The entire result printed out:<br />";
- echo "<pre>";
- print_r($result);
- echo "</pre>";
- echo "API Call:<br />".$url."/api/3/contacts";
- ERROR:
- $cd backupscripts/
- $ ls
- sample.sh
- $ ./sample.sh
- ./sample.sh: line 4: syntax error near unexpected token `('
- ./sample.sh: line 4: `ch=curl_init();'
- ./sample.sh: line 4: syntax error near unexpected token `('
- ./sample.sh: line 4: `ch=curl_init();'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement