Get project details

Description

Returns all the details of a project. If the project has reads, their details also returned.

Response example

{
  "projects":[
    {
      "id":"2",
      "user":false,
      "status":"disposed",
      "fulfilmentType":"speedy",
      "title":"My Test Project",
      "language":"eng-us",
      "genderAndAge":"middleAgeMale",
      "script":{
        "part001":"Hello world."
      },
      "serviceFee":"1.2",
      "currency":"usd",
      "remarks":"Special instructions",
      "lifetime":"86000",
      "assignmentDuration":"603",
      "test":false,
      "created":1315692607,
      "units":"2",
      "genderAndAgeName":"Middle age (40-65) | Male",
      "languageName":"English - North American",
      "maxEntrants":false,
      "auditionScript":false,
      "reads":[
        {
          "id":"1",
          "talentID":"",
          "status":"reviewable",
          "created":1327403069,
          "urls":{
            "part001":{
              "default":"http:\/\/voicebunny.s3.amazonaws.com\/dev\/2_aa70601bd0c0c323872c2d81e93f369f.mp3?h=1",
              "original":"http:\/\/voicebunny.s3.amazonaws.com\/dev\/2_e8861ad42488c482426bc6ae59437b79.wav?h=1"
            }
          }
        }
      ],
      "auditions":false,
      "talendID":null,
      "syncedRecording":false,
      "excludePrevious":false,
      "secret":false
    }
  ],
  "timestamp":1369404993
}
<?xml version="1.0" encoding="UTF-8"?>
<projects>
  <project>
    <id>2</id>
    <user>0</user>
    <status>disposed</status>
    <fulfilmentType>speedy</fulfilmentType>
    <title>My Test Project</title>
    <language>eng-us</language>
    <genderAndAge>middleAgeMale</genderAndAge>
    <script>
      <part001>Hello world.</part001>
    </script>
    <serviceFee>1.2</serviceFee>
    <currency>usd</currency>
    <remarks>Special instructions</remarks>
    <lifetime>86000</lifetime>
    <assignmentDuration>603</assignmentDuration>
    <test>0</test>
    <created>1315692607</created>
    <units>2</units>
    <genderAndAgeName>Middle age (40-65) | Male</genderAndAgeName>
    <languageName>English - North American</languageName>
    <maxEntrants>0</maxEntrants>
    <auditionScript>0</auditionScript>
    <reads>
      <read>
        <id>1</id>
        <talentID/>
        <status>reviewable</status>
        <created>1327403069</created>
        <urls>
          <part001>
            <default>http://voicebunny.s3.amazonaws.com/dev/2_aa70601bd0c0c323872c2d81e93f369f.mp3?h=1</default>
            <original>http://voicebunny.s3.amazonaws.com/dev/2_e8861ad42488c482426bc6ae59437b79.wav?h=1</original>
          </part001>
        </urls>
      </read>
    </reads>
    <auditions>0</auditions>
    <talendID/>
    <syncedRecording>0</syncedRecording>
    <excludePrevious>0</excludePrevious>
    <secret>0</secret>
  </project>
  <timestamp>1369404993</timestamp>
</projects>

Errors

  • 5003: No results were found.

Code example

@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.2' )

import groovyx.net.http.*
import groovy.json.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*

http = new HTTPBuilder('https://api.voicebunny.com')
http.handler.success = {response, json -> return json}
http.handler.failure = {response, json -> throw new RuntimeException(json.error.code + ' ' + json.error.message)}
def voicebunnyUser = 'xxXXxx'
def voicebunnyToken = 'xxxxXXXXxxxxXXXX'
def projectId = 'xx'
http.auth.basic voicebunnyUser, voicebunnyToken
def project = http.get(path: "projects/${projectId}", requestContentType: URLENC)
import java.io.*;
import java.net.*;
import sun.misc.BASE64Encoder;

public class Voicebunny {

    private String user = "xxXXxx";

    private String token = "xxxxXXXXxxxxXXXX";

    private String encodedAuthorization = "";

    private String host = "https://api.voicebunny.com";

    public Voicebunny() {
        String userpassword = user + ":" + token;
        encodedAuthorization = new BASE64Encoder().encode(userpassword.getBytes());
    }

    public static void main(String[] args) throws IOException {
        Voicebunny vb = new Voicebunny();
        System.out.println(vb.getProject("projectId"));
    }

    private String getProject(String id) throws MalformedURLException, IOException, ProtocolException {
        return get("projects/" + id);
    }

    private String get(String resource) throws IOException, ProtocolException {
        URL url = new URL(host + "/" + resource);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Authorization", "Basic " + encodedAuthorization);
        connection.connect();
        InputStream in = connection.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        StringBuffer sb = new StringBuffer();
        String line = "";
        while ((line = reader.readLine()) != null) {
            sb.append(line);
        }
        reader.close();

        return sb.toString();
    }

}
<?php
$projectId = 'x';
$url_api = 'https://api.voicebunny.com/projects/' . $projectId;
$opts = array(
	CURLOPT_URL => $url_api,
	CURLOPT_RETURNTRANSFER => TRUE,
	CURLOPT_INFILESIZE => -1,
	CURLOPT_TIMEOUT => 60,
	CURLOPT_SSL_VERIFYPEER => false,
	CURLOPT_HTTPGET => TRUE,
);
$curl = curl_init();
curl_setopt_array($curl, $opts);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
print_r($response);
?>
import requests
import simplejson
from requests.auth import HTTPBasicAuth

url = 'https://api.voicebunny.com'
api_id = 'XX'
api_key = "xxxxXXXXxxxxXXXX"
project_id = 'XX'
req = requests.get(url+'/projects/'+project_id,
   auth=HTTPBasicAuth(api_id, api_key),verify=False)
data = simplejson.loads(req.text)
response = data['projects']
require 'faraday'
require 'faraday_middleware'

@conn = nil
@api_id = "XX"
@api_key = "xxxxXXXXxxxxXXXX"
project_id = "X"
resp = nil

@conn = Faraday.new(:url =>("https://"+ @api_id+":"+@api_key +"@api.voicebunny.com"),:ssl => {:verify => false}) do |builder|
	builder.use Faraday::Request::Multipart
	builder.use Faraday::Request::UrlEncoded
	builder.use Faraday::Response::ParseJson
	builder.use Faraday::Adapter::NetHttp		  
end

resp = @conn.get '/projects/'+project_id+'.json'
resp.body