Add speedy projects

Speedy /ˈspēdē/ Project open to multiple voice actors hand picked by Mr. Bunny in which only one voice actor is allowed to accept it and work it.

Description

Creates a new speedy project to obtain one voice recording (read) quickly (see quickstart and flowchart). VoiceBunny will try to obtain the best voice(s) for the project, given the price and lifetime of the project.

To test this operation, set the argument test to "1". See details below.

Arguments

= required
= only one of these is required
NameTypeDescriptionDefault value
script
textText that will be read by voice actors. Write instructions inside of [ ]. They won't count towards the word/character total. If you want to receive multiple files, submit the different parts as a JSON array, naming the key of each element anyway you wish (see advanced example below). The name of each key will be used to name the audio files.
title
stringDescriptive text about the project of up to 50 characters. This text is the first reference that voice actors will have about your project. Using it wisely will help you attract more and better voice actors.
genderAndAgestringGender and age wanted for the read. Valid values can be obtained with the /genderAndAges operation.middleAgeMale
languagestringLanguage (and regional accent) wanted for the read. Valid values can be obtained with the /languages operation.eng-us
lifetimeinteger Lifetime of the project in seconds. VoiceBunny will try to fulfill the project within this timeframe. Longer lifetimes will give VoiceBunny more time to find a great voice, as voice actors with higher ratings will have more time to accept the project. Shorter lifetimes will force VoiceBunny to open up the project to voice actors with lower ratings. You can compensate lower lifetimes with higher rewards (see price).84600 seconds (1 day)
syncedRecordingintegerSet this argument to "1" if the recording needs to be synced. For example: synchronization with a video or presentation. The price of the project will be 50% higher.0
testbooleanSet this argument to "1" to test this operation. When set to "1", the project won't affect your account balance and it will automatically get a fake read within 120 seconds.0
excludePreviousintegerNumber of your previous projects to be considered for excluding certain voice actors from working on this project. Use it to avoid getting the same voices you have received for your previous projects.
pingstringUse it to be notified as the project has new reads in status "reviewable". Possible values are:
Empty: No notifications will be sent.
"email": A message will be sent to your account's email address.
A valid email address: A message will be sent to the given email address.
A valid URL: The given URL will be called via a "get" request, expecting a 200, 201, or 202 response. You may use as many URL parameters as you need.
pricefloatPrice paid for the project. If left empty, VoiceBunny will automatically set its default rates. You can learn in advanced what the value will be using the /projects/quote operation. Offering a higher price will attract our best voice actor to your project much faster. If you want help setting the price, contact Mr. VoiceBunny.
remarkstextUse this field to provide additional information to the voice actors. For example: type of read (movie trailer voice, commercial, phone greeting, etc.), links to videos, links to other reads you like, links to other project, links to images, etc. Learn to provide great directions to voice actors.

Response example

{
  "project":{
    "id":"2",
    "user":"42",
    "status":"disposed",
    "fulfilmentType":"speedy",
    "title":"My Test Project",
    "language":"eng-us",
    "genderAndAge":"middleAgeMale",
    "script":{
      "part001":"Hello world."
    },
    "price":"11.0100004673004",
    "currency":"USD",
    "remarks":"Special instructions",
    "lifetime":"86000",
    "assignmentDuration":"603",
    "test":0,
    "created":1315692607,
    "units":"2",
    "genderAndAgeName":"Male | Middle age (40-65)",
    "languageName":"English - North America",
    "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":0,
    "excludePrevious":false
  },
  "timestamp":1425599851
}
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <project>
    <id>2</id>
    <user>42</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>
    <price>11.0100004673004</price>
    <currency>USD</currency>
    <remarks>Special instructions</remarks>
    <lifetime>86000</lifetime>
    <assignmentDuration>603</assignmentDuration>
    <test>0</test>
    <created>1315692607</created>
    <units>2</units>
    <genderAndAgeName>Male | Middle age (40-65)</genderAndAgeName>
    <languageName>English - North America</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>
  </project>
  <timestamp>1425599851</timestamp>
</project>

Errors

  • 5002: Your account balance is too low and you don't have a credit card on file we can automatically charge. Please add funds or your credit card info at http://voicebunny.com/account
  • 5005: The "title" argument cannot be empty. Please use a descriptive text about the project. This text is the first reference that voice actors will have about your project. Using it wisely will help you attract more and better voice actors.
  • 5007: The "language" argument is not valid. You can get the list of available languages and accents using the API operation /languages.
  • 5008: The "genderAndAge" argument is not valid. You can get the list of available "gender and ages" using the API operation /genderAndAges.
  • 5009: The "script" argument cannot be empty.
  • 5011: The "price" argument should be empty or it should be a positive float number.
  • 5037: The "ping" argument should be an email address, an URL, "email", or be empty.
  • 5039: The "lifetime" argument should be a positive number, or it should be empty.
  • 5048: The "title" argument is too long. Please limit it to 100 characters.
  • 5073: The "price" argument must be at or above Mr. Bunny's suggested rate. Remember, better rewards attract better, faster voice actors.
  • 5080: Some parts of the script are empty, please remove them or add some information.
  • 5150: Projects can have a maximum of 32 parts. If you need more please contact us http://voicebunny.com/pages/contact for help.
  • 5152: The "excludePrevious" should be empty or it should be a positive integer number.

Basic 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.*

def projectData = [
	script: 'Hello world.',
	title: 'My Test Project'
]

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'
http.auth.basic voicebunnyUser, voicebunnyToken
def newProject = http.post(path: 'projects/addSpeedy', body: projectData, requestContentType: URLENC)
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.Map.Entry;
import org.apache.commons.codec.binary.Base64;

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 = Base64.encodeBase64String(userpassword.getBytes());
    }

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

    private String postProject() throws MalformedURLException, IOException, ProtocolException {
        Map<String, String> params = new HashMap<String, String>();
        params.put("script", "Hello world.");
        params.put("title", "My Test Project");
        return post("projects/addSpeedy", params);
    }

    private String post(String resource, Map<String, String> params) throws UnsupportedEncodingException, MalformedURLException, IOException, ProtocolException {
        String data = "";
        for (Entry<String, String> entry : params.entrySet()) {
            if (!data.isEmpty()) {
                data += "&";
            }
            data += (URLEncoder.encode(entry.getKey(), "UTF-8") + "=" + URLEncoder.encode(entry.getValue(), "UTF-8"));
        }

        URL url = new URL(host + "/" + resource);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Authorization", "Basic " + encodedAuthorization);
        connection.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
        wr.write(data);
        wr.flush();
        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);
        }
        wr.close();
        reader.close();
        return sb.toString();
    }

}
var postParams = {
    title: 'My Test Project',
    script: 'Hello world.'
};

var requestParams = querystring.stringify(postParams);
var voicebunnyUser = 'xxXXxx';
var voicebunnyToken = 'xxxxXXXXxxxxXXXX';
var options = {
    host: 'api.voicebunny.com',
    port: 443,
    path: 'projects/addSpeedy',
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Content-Length': requestParams.length,
        'Authorization': 'Basic ' + new Buffer(voicebunnyUser + ':' + voicebunnyToken).toString('base64')
    }
};

var req = https.request(options, function (res) {
    res.setEncoding('utf8');
    res.on('data', function (data) {
        console.log(data);
    });
});
req.write(requestParams);
req.end();
<?php
$voicebunnyUser = 'xxXXxx';
$voicebunnyToken = 'xxxxXXXXxxxxXXXX';
$url_api = 'https://api.voicebunny.com/projects/addSpeedy';
$postVars = array(
	'title' => 'My Test Project',
	'script' => 'Hello world.'
);
$vars = http_build_query($postVars);
$opts = array(
	CURLOPT_URL => $url_api,
	CURLOPT_RETURNTRANSFER => TRUE,
	CURLOPT_INFILESIZE => -1,
	CURLOPT_TIMEOUT => 60,
	CURLOPT_SSL_VERIFYPEER => false,
	CURLOPT_POST => TRUE,
	CURLOPT_POSTFIELDS => $vars,
	CURLOPT_USERPWD => $voicebunnyUser . ':' . $voicebunnyToken,
);
$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"
req = requests.post(url+'/projects/addSpeedy',
   data={
        'title': 'My Test Project',
        'script': 'Hello world.'
   }, 
   auth=HTTPBasicAuth(api_id, api_key),verify=False)
data = simplejson.loads(req.text)
response = data['project']
require 'faraday'
require 'faraday_middleware'

@conn = nil
@api_id = "XX"
@api_key = "xxxxXXXXxxxxXXXX"
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.post '/projects/addSpeedy.json', {
	script: 'Hello world.',
	title: 'My Test Project'
}

resp.body

Advanced 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.*

def projectData = [
	script: '{
            "Part001":"[make voice like you are giving a speech] Hello world.",
            "Part002:"I am mr. VoiceBunny",
            "Part003":"[with animosity] I have to go! Bye!"
        }',
	title: 'Mr. VoiceBunny introduction',
	language: 'eng-us',
	genderAndAge: 'middleAgeMale',
	lifetime: 86400,
	remarks: 'I want a really friendly voice, in the Part002 please be enfatic.',
	syncedRecording: 1,
	ping: 'api@voicebunny.com',
	price: 50
]

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'
http.auth.basic voicebunnyUser, voicebunnyToken
def newProject = http.post(path: 'projects/addSpeedy', body: projectData, requestContentType: URLENC)
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.Map.Entry;
import org.apache.commons.codec.binary.Base64;

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 = Base64.encodeBase64String(userpassword.getBytes());
    }

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

    private String postProject() throws MalformedURLException, IOException, ProtocolException {
        Map<String, String> params = new HashMap<String, String>();
params.put("script", "{
            "Part001":"[make voice like you are giving a speech] Hello world.",
            "Part002":"I am mr. VoiceBunny",
            "Part003":"[with animosity] I have to go! Bye!"
        }");
        params.put("title", "Mr. VoiceBunny introduction");
        params.put("language", "eng-us");
        params.put("genderAndAge", "middleAgeMale");
        params.put("lifetime", "86400");
        params.put("remarks", "I want a really friendly voice, in the Part002 please be enfatic.");
	params.put("timedRecording", "1,");
	params.put("ping", "api@voicebunny.com");
	params.put("price", "50.00");
        return post("projects/addSpeedy", params);
    }

    private String post(String resource, Map<String, String> params) throws UnsupportedEncodingException, MalformedURLException, IOException, ProtocolException {
        String data = "";
        for (Entry<String, String> entry : params.entrySet()) {
            if (!data.isEmpty()) {
                data += "&";
            }
            data += (URLEncoder.encode(entry.getKey(), "UTF-8") + "=" + URLEncoder.encode(entry.getValue(), "UTF-8"));
        }

        URL url = new URL(host + "/" + resource);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Authorization", "Basic " + encodedAuthorization);
        connection.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
        wr.write(data);
        wr.flush();
        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);
        }
        wr.close();
        reader.close();
        return sb.toString();
    }

}
var postParams = {
    title: 'Mr. VoiceBunny introduction',
    script: '{
            "Part001":"[make voice like you are giving a speech] Hello world.",
            "Part002":"I am mr. VoiceBunny",
            "Part003":"[with animosity] I have to go! Bye!"
        }',
    language: 'eng-us',
    genderAndAge: 'middleAgeMale',
    lifetime: 86400,
    remarks: 'I want a really friendly voice, in the Part002 please be enfatic.'
    syncedRecording: 1,
    ping: 'api@voicebunny.com',
    price: 50
};

var requestParams = querystring.stringify(postParams);
var voicebunnyUser = 'xxXXxx';
var voicebunnyToken = 'xxxxXXXXxxxxXXXX';
var options = {
    host: 'api.voicebunny.com',
    port: 443,
    path: 'projects/addSpeedy',
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Content-Length': requestParams.length,
        'Authorization': 'Basic ' + new Buffer(voicebunnyUser + ':' + voicebunnyToken).toString('base64')
    }
};

var req = https.request(options, function (res) {
    res.setEncoding('utf8');
    res.on('data', function (data) {
        console.log(data);
    });
});
req.write(requestParams);
req.end();
<?php
$voicebunnyUser = 'xxXXxx';
$voicebunnyToken = 'xxxxXXXXxxxxXXXX';
$url_api = 'https://api.voicebunny.com/projects/addSpeedy';
$postVars = array(
	'title' => 'Mr. VoiceBunny introduction',
	'language' => 'eng-us',
	'genderAndAge' => 'middleAgeMale',
	'script' => '{
            "Part001":"[make voice like you are giving a speech] Hello world.",
            "Part002":"I am mr. VoiceBunny",
            "Part003":"[with animosity] I have to go! Bye!"
        }',
	'lifetime' => 86400,
	'remarks' =>  'I want a really friendly voice, in the Part002 please be enfatic.',
	'syncedRecording' =>  1,
	'ping' =>  'api@voicebunny.com',
	'price' =>  50,
);
$vars = http_build_query($postVars);
$opts = array(
	CURLOPT_URL => $url_api,
	CURLOPT_RETURNTRANSFER => TRUE,
	CURLOPT_INFILESIZE => -1,
	CURLOPT_TIMEOUT => 60,
	CURLOPT_SSL_VERIFYPEER => false,
	CURLOPT_POST => TRUE,
	CURLOPT_POSTFIELDS => $vars,
	CURLOPT_USERPWD => $voicebunnyUser . ':' . $voicebunnyToken,
);
$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"
req = requests.post(url+'/projects/addSpeedy',
   data={
        'title': 'Mr. VoiceBunny introduction',
        'script': '{
            "Part001":"[make voice like you are giving a speech] Hello world.",
            "Part002":"I am mr. VoiceBunny",
            "Part003":"[with animosity] I have to go! Bye!"
        }',
        'language': 'eng-us',
        'genderAndAge': 'middleAgeMale',
        'lifetime': '86400',
        'remarks': "I want a really friendly voice, in the Part002 please be enfatic.",
	'syncedRecording': '1',
	'ping': "api@voicebunny.com",
	'price': '50'
   }, 
   auth=HTTPBasicAuth(api_id, api_key),verify=False)
data = simplejson.loads(req.text)
response = data['project']
require 'faraday'
require 'faraday_middleware'

@conn = nil
@api_id = "XX"
@api_key = "xxxxXXXXxxxxXXXX"
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.post '/projects/addSpeedy.json', {
	script: '{
            "Part001":"[make voice like you are giving a speech] Hello world.",
            "Part002":"I am mr. VoiceBunny",
            "Part003":"[with animosity] I have to go! Bye!"
        }',
	title: 'Mr. VoiceBunny introduction',
	language: 'eng-us',
	genderAndAge: 'middleAgeMale',
	lifetime: 86400,
	remarks: 'I want a really friendly voice, in the Part002 please be enfatic.',
	syncedRecording: 1,
	ping: 'api@voicebunny.com',
	price: 50
}

resp.body
Bunny Inc
Main address: 1355 Market St. Suite #488 94103 San Francisco, California, USA
Tel: (+1) 415-749-9221 E-mail: support@voicebunny.com