Request revision

Description

Request a revision to a read. VoiceBunny will notify the talent of the requested changes. As long as there are no major changes to the script, we'll revise it for free, otherwise you'll just pay for the words or characters that changed that changed. You can find out the price for revisions using the revision quote method. We will still save the original versions of each recording for you to access at anytime.

To test this method, request a revision of a test read generated by creating a test project.

Arguments

= required
= only one of these is required
NameTypeDescriptionDefault value
charactersToBeRecorded
integerThe number of characters that need to be added or re-recorded. Use this argument only if the language of the project is character based.
wordsToBeRecorded
integerThe number of words that need to be added or re-recorded. Use this argument only if the language of the project is word based.
instructions
textUse this field to give specific instructions to VoiceBunny about the issues with the read.
changingScriptbooleanSet this argument to "1" if you are changing the script. When set to "0", the revision is free of charge.0
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.

Response example

{
  "revision":{
    "id":"1",
    "read":"1",
    "user":false,
    "status":"revisionCanceled",
    "url":false,
    "units":"1",
    "price":"6",
    "currency":"USD",
    "changingScript":true,
    "instructions":"I didn't like the way the talent pronounced the word \"Hi\".",
    "created":1345776747,
    "test":true
  },
  "timestamp":1568710065
}
<?xml version="1.0" encoding="UTF-8"?>
<revisions>
  <revision>
    <id>1</id>
    <read>1</read>
    <user>0</user>
    <status>revisionCanceled</status>
    <url>0</url>
    <units>1</units>
    <price>6</price>
    <currency>USD</currency>
    <changingScript>1</changingScript>
    <instructions>I didn't like the way the talent pronounced the word "Hi".</instructions>
    <created>1345776747</created>
    <test>1</test>
  </revision>
  <timestamp>1568710065</timestamp>
</revisions>

Errors

  • 5018: The ID in the url makes reference to a deliverable that does not exist.
  • 5082: The value of the argument "wordsToBeRecorded" should be a positive integer.
  • 5083: The pricing for this language is based on the number of characters. Please use the argument "charactersToBeRecorded" instead. The value of the argument "wordsToBeRecorded" should be null.
  • 5084: The value of the argument "charactersToBeRecorded" should be a positive integer.
  • 5085: The pricing for this language is based on the number of words. Please use the argument "wordsToBeRecorded" instead. The value of the argument "charactersToBeRecorded" should be null.
  • 5087: The argument "changingInstructions" should be 1 or 0. If "0", you won't pay for this revision. If "1" you'll pay for this revision.
  • 5088: You are not authorized to modify this project. Only the owner can modify it.
  • 5089: The argument "instructions" cannot be empty.
  • 5090: Revisions cannot be requested for deliverables of with type="entry".
  • 5095: You cannot request revisions for future or rejected reads.
  • 5099: Oh, man. This is sad. Apparently this talent has closed his account and is no longer working for Mr. Bunny. You can repost this project or contact us for help.
  • 5109:
  • 5114:

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'
http.auth.basic voicebunnyUser, voicebunnyToken
def data = [
	wordsToBeRecorded: 1,
	voiceBunnyError: 1,
	instructions: 'I didnt like the pronountiation of letter A.'
]
def quote = http.post(path: '/reads/1/revision/add', body: data, 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.quoteProject());
    }

    private String quoteProject() throws UnsupportedEncodingException, MalformedURLException, ProtocolException, IOException {
        Map<String, String> params = new HashMap<String, String>();
        params.put("wordsAddedOrChanged", "1");
        params.put("voiceBunnyError", "1");	
        params.put("instructions", "I didnt like the pronountiation of letter A.");
        return post("/reads/1/revision/add", 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();
    }

}
<?php
$url_api = 'https://api.voicebunny.com/reads/1/revision/add';
$postVars = array(
	'wordsToBeRecorded'=>'1',
	'voiceBunnyError'=>'1',
	'instructions'=>'I didnt like the pronountiation of letter A.'
);
$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.get(url+'/reads/1/revision/add', 
    data={'voiceBunnyError': '1',
    'wordsToBeRecorded': '1',
	'instructions': 'I didnt like the pronountiation of letter A.'},
    auth=HTTPBasicAuth(api_id, api_key),verify=False)
data = simplejson.loads(req.text)
response = data['quote']
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
end

resp = @conn.post '/reads/1/revision/add', {
	wordsToBeRecorded: '1',
        voiceBunnyError: '1',
        instructions: 'I didnt like the pronountiation of letter A.'
}
resp.body