• GET candidate example

    public function tbApiExample() {
        $tb_client_id = "your_client_id";
        $tb_client_secret = "your_client_secret";
        $baseUrl = "http://app.tempbuddy.com/apiC/1.0/candidate.json?"
    
        //Query params to filter the search, like the id
        $queryParams = array(
            'ids' => 1234 //search the item with the id "1234"
        );
    
        $url = $baseUrl . http_build_query($queryParams);
        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => array(
                //These fields are needed to verify your id
                "client_id" => $tb_client_id,
                "client_secret" => $tb_client_secret
            )
        ));
        $result = curl_exec($curl);
        curl_close($curl);
        return json_decode($result);
    }
    curl -X POST \
      http://app.tempbuddy.com/apiC/1.0/candidate.json \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'client_id: your_client_id' \
      -H 'client_secret: your_client_secret'
  • POST candidate example

    public function tbApiPostExample() {
        var client_id = "your_client_id";
        var client_secret = "your_client_secret";
        var url = "http://app.tempbuddy.com/apiC/1.0/candidate/post.json";
        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => array(
                //Auth params
                "client_id" => $tb_client_id,
                "client_secret" => $tb_client_secret,
                //New candidate params. All params are passed by POST method
                "status" => "Available",
                "username" => "MyNewCandidate",
                "email" => "my@email.com",
                "password" => "myPass",
                "name" => "Candidate Name",
                "dob" => "1980-12-01",
                "phone" => "+987654321",
                "address" => "London",
                //Any additional param
            )
        ));
        $result = curl_exec($curl);
        curl_close($curl);
        return json_decode($result);
    }
    curl -X POST \
      http://app.tempbuddy.com/apiC/1.0/candidate/post.json \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'client_id: your_client_id' \
      -H 'client_secret: your_client_secret' \
      -d 'status=Available&username=MyNewCandidate&email=my@email.com&password=myPass&name=Candidate%20name&dob=1980-12-01&phone=%2B987654321&address=London'
  • PUT candidate example

    public function tbApiPutExample() {
        var client_id = "your_client_id";
        var client_secret = "your_client_secret";
        var url = "http://app.tempbuddy.com/apiC/1.0/candidate/put.json";
        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => array(
                //Auth params
                "client_id" => $tb_client_id,
                "client_secret" => $tb_client_secret,
                //Select candidate and mandatory params
                "id" => "1249",
                "status" => "Available",
                //Update params
                "email" => "updated@mail.com",
                "facebook" => "myNewFBook"
            )
        ));
        $result = curl_exec($curl);
        curl_close($curl);
        return json_decode($result);
    }
    curl -X POST \
      http://app.tempbuddy.com/apiC/1.0/candidate/put.json \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'client_id: your_client_id' \
      -H 'client_secret: your_client_secret' \
      -d 'id=1249&status=Available&username=MyNewCandidate&email=my@email.com&password=myPass&name=Candidate%20name&dob=1980-12-01&phone=%2B987654321&address=London'
  • DELETE candidate example

    public function tbApiDELETEExample() {
        var client_id = "your_client_id";
        var client_secret = "your_client_secret";
        var url = "http://app.tempbuddy.com/apiC/1.0/candidate/delete.json";
        $curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => array(
                //Auth params
                "client_id" => $tb_client_id,
                "client_secret" => $tb_client_secret,
                //Select candidate to be deleted
                "id" => 1249
            )
        ));
        $result = curl_exec($curl);
        curl_close($curl);
        return json_decode($result);
    }
    curl -X POST \
      http://app.tempbuddy.com/apiC/1.0/candidate/delete.json \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'client_id: your_client_id' \
      -H 'client_secret: your_client_secret' \
      -d 'id=1249'