Get revision details

Description

Returns all the details of a revision.

Response example

{
  "revision":{
    "id":"39576",
    "status":"revisionPosted",
    "read":"935654",
    "url":{
      "Part 1":{
        "default":"https:\/\/voicebunny.s3.amazonaws.com\/live\/VoiceBunny_-_1-product-12_-_Deliverable_935654_Part_1_by_VoiceActor_5R20VKK.mp3?h=7539",
        "pcm":"https:\/\/voicebunny.s3.amazonaws.com\/live\/VoiceBunny_-_1-product-12_-_Deliverable_935654_Part_1_by_VoiceActor_5R20VKK_8khz.wav?h=8391",
        "original":"https:\/\/voicebunny.s3.amazonaws.com\/live\/VoiceBunny_-_1-product-12_-_Deliverable_935654_Part_1_by_VoiceActor_5R20VKK.wav?h=8999"
      }
    },
    "created":1482251547
  },
  "timestamp":1568710099
}
<?xml version="1.0" encoding="UTF-8"?>
<revisions>
  <revision>
    <id>39576</id>
    <status>revisionPosted</status>
    <read>935654</read>
    <url>
      <part>
        <default>https://voicebunny.s3.amazonaws.com/live/VoiceBunny_-_1-product-12_-_Deliverable_935654_Part_1_by_VoiceActor_5R20VKK.mp3?h=7539</default>
        <pcm>https://voicebunny.s3.amazonaws.com/live/VoiceBunny_-_1-product-12_-_Deliverable_935654_Part_1_by_VoiceActor_5R20VKK_8khz.wav?h=8391</pcm>
        <original>https://voicebunny.s3.amazonaws.com/live/VoiceBunny_-_1-product-12_-_Deliverable_935654_Part_1_by_VoiceActor_5R20VKK.wav?h=8999</original>
        <name>Part 1</name>
      </part>
    </url>
    <created>1482251547</created>
  </revision>
  <timestamp>1568710099</timestamp>
</revisions>

Errors

  • 5003: No results were found.
  • 5094: The revision ID is not valid.
  • 5172: The deliverable does not exist.

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 readId = 'x'
def revisionId = 'x
http.auth.basic voicebunnyUser, voicebunnyToken
def read = http.get(path: 'reads/' + readId + '/revision/' + revisionId, requestContentType: URLENC)
import java.io.*;
import java.net.*;
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.getRevision("readId", "revisionId"));
    }

    private String getRevision(String readId, String revisionId) throws ProtocolException, IOException {
        return get("reads/" + readId + "/revision/" + revisionId);
    }

    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
$readId = 'x';
$revisionId = 'x'
$url_api = 'https://api.voicebunny.com/reads/' . $readId . '/revision/' . $revisionId;
$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"
read_id = 'XX'
revision_id = 'XX'
req = requests.get(url+'/reads/'+read_id+'/revision/'+revision_id',
    auth=HTTPBasicAuth(api_id, api_key),verify=False)
data = simplejson.loads(req.text)
response = data['reads']
require 'faraday'
require 'faraday_middleware'

@conn = nil
@api_id = "XX"
@api_key = "xxxxXXXXxxxxXXXX"
read_id = "X"
revision_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 '/reads/'+read_id+'/revision/'+revision_id+'.json'
resp.body