.NET

Get


var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get,
"https://api.worldoffice.cloud/api/v1/documentos/getDocumentoId/23440");
request.Headers.Add("Authorization", "$token");
var content = new StringContent(string.Empty);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Post


var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post,
"https://api.worldoffice.cloud/api/v1/compra/listarDocumentoCompra");
request.Headers.Add("Authorization", "$token");
var content = new StringContent("{\"columnaOrdenar\": \"id\",\"pagina\": 0,\"registrosPorPagina\":
1,\"orden\": \"ASC\",\"filtros\": [{\"atributo\": \"documentoTipo.codigoDocumento\",\"valor\":
\"FC\",\"valor2\": null,\"tipoFiltro\": 0,\"tipoDato\": 0,\"nombreColumna\": null,\"valores\":
null,\"clase\": null,\"operador\": 0,\"subGrupo\": \"filtro\"}],\"canal\": 0}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Put


var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put,
"https://api.worldoffice.cloud/api/v1/documentos/editarDocumentoVenta");
request.Headers.Add("Authorization", "$token");
var content = new StringContent("{ \"id\":24305,\"fecha\":\"2023-07-
15\",\"prefijo\":1,\"documentoTipo\":\"FV\",\"idEmpresa\":2,\"idTerceroExterno\":2946,\"idTerceroI
nterno\":3664,\"idFormaPago\":5,\"idMoneda\":31,\"trm\":\"1\",\"porcentajeDescuento\":true,\"po
rcentajeTodosRenglones\":true,\"valDescuento\":0,\"reglones\":[{\"id\":38988,\"idInventario\":4517,
\"unidadMedida\":\"doc\",\"cantidad\":\"2\",\"valorUnitario\":\"1000\",\"idBodega\":1,\"porDescue
nto\":0,\"concepto\":\"hola nota primera\"
},{\"idInventario\":5,\"unidadMedida\":\"und\",\"cantidad\":\"1\",\"valorUnitario\":\"100000\",\"idB
odega\":1,\"porDescuento\":0,\"concepto\":\"televisor\" }],\"idDetalles\":[]}", null,
"application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Delete


var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete,
"https://api.worldoffice.cloud/api/v1/documentos/eliminar/23605");
request.Headers.Add("Authorization", "$token");
var content = new StringContent(string.Empty);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

JAVA

Get


OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.worldoffice.cloud/api/v1/documentos/getDocumentoId/23440")
.method("GET", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "$token")
.build();
Response response = client.newCall(request).execute(); 

Post


OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"columnaOrdenar\": \"id\",\"pagina\":
0,\"registrosPorPagina\": 1,\"orden\": \"ASC\",\"filtros\": [{\"atributo\":
\"documentoTipo.codigoDocumento\",\"valor\": \"FC\",\"valor2\": null,\"tipoFiltro\": 0,\"tipoDato\":
0,\"nombreColumna\": null,\"valores\": null,\"clase\": null,\"operador\": 0,\"subGrupo\":
\"filtro\"}],\"canal\": 0");
Request request = new Request.Builder()
.url("https://api.worldoffice.cloud/api/v1/compra/listarDocumentoCompra")
.method("POST", body)
.addHeader("Authorization", "$token")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();

Put


OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \"id\":24305,\"fecha\":\"2023-07-
15\",\"prefijo\":1,\"documentoTipo\":\"FV\",\"idEmpresa\":2,\"idTerceroExterno\":2946,\"idTerceroI
nterno\":3664,\"idFormaPago\":5,\"idMoneda\":31,\"trm\":\"1\",\"porcentajeDescuento\":true,\"po
rcentajeTodosRenglones\":true,\"valDescuento\":0,\"reglones\":[{\"id\":38988,\"idInventario\":4517,
\"unidadMedida\":\"doc\",\"cantidad\":\"2\",\"valorUnitario\":\"1000\",\"idBodega\":1,\"porDescue	
nto\":0,\"concepto\":\"hola nota primera\"
},{\"idInventario\":5,\"unidadMedida\":\"und\",\"cantidad\":\"1\",\"valorUnitario\":\"100000\",\"idB
odega\":1,\"porDescuento\":0,\"concepto\":\"televisor\" }],\"idDetalles\":[]}");
Request request = new Request.Builder()
.url("https://api.worldoffice.cloud/api/v1/documentos/editarDocumentoVenta")
.method("PUT", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "$token")
.build();
Response response = client.newCall(request).execute();

Delete


OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.worldoffice.cloud/api/v1/documentos/eliminar/23605")
.method("DELETE", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "$token")
.build();
Response response = client.newCall(request).execute();

PHP

Get


?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.worldoffice.cloud/api/v1/documentos/getDocumentoId/23440',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
Content-Type: application/json',
Authorization: $token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Post


?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.worldoffice.cloud/api/v1/compra/listarDocumentoCompra',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"columnaOrdenar": "id",
"pagina": 0,
"registrosPorPagina": 1,
"orden": "ASC",
"filtros": [
{
"atributo": "documentoTipo.codigoDocumento",
"valor": "FC",
"valor2": null,
"tipoFiltro": 0,
"tipoDato": 0,
"nombreColumna": null,
"valores": null,
"clase": null,
"operador": 0,
"subGrupo": "filtro"
}
],
"canal": 0
}',
CURLOPT_HTTPHEADER => array(
'Authorization: $token',
'Content-Type: application/json'
),
));			
$response = curl_exec($curl);			
curl_close($curl);
echo $response;			

Put


?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.worldoffice.cloud/api/v1/documentos/editarDocumentoVenta',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"id":24305,
"fecha":"2023-07-15",
"prefijo":1,
"documentoTipo":"FV",
"idEmpresa":2,
"idTerceroExterno":2946,
"idTerceroInterno":3664,
"idFormaPago":5,
"idMoneda":31,
"trm":"1",
"porcentajeDescuento":true,
"porcentajeTodosRenglones":true,
"valDescuento":0,
"reglones":[
{
"id":38988,
"idInventario":4517,
"unidadMedida":"doc",
"cantidad":"2",
"valorUnitario":"1000",
"idBodega":1,
"porDescuento":0,
"concepto":"hola nota primera" 
},
{
"idInventario":5,
"unidadMedida":"und",
"cantidad":"1",
"valorUnitario":"100000",
"idBodega":1,
"porDescuento":0,
"concepto":"televisor" 
}
],
"idDetalles":[]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: $token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Delete


?php
$curl = curl_init();			
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.worldoffice.cloud/api/v1/documentos/eliminar/23605',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: $token'
),
));			
$response = curl_exec($curl);			
curl_close($curl);
echo $response;			

PYTHON

Get


import http.client
import json
conn = http.client.HTTPSConnection("api.worldoffice.cloud")
payload = ''
headers = {
'Content-Type': 'application/json',
'Authorization': '$token'
}
conn.request("GET", "/api/v1/documentos/getDocumentoId/23440", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Post


import http.client
import json
conn = http.client.HTTPSConnection("api.worldoffice.cloud")
payload = json.dumps({
"columnaOrdenar": "id",
"pagina": 0,
"registrosPorPagina": 1,
"orden": "ASC",
"filtros": [
{
"atributo": "documentoTipo.codigoDocumento",
"valor": "FC",
"valor2": None,
"tipoFiltro": 0,
"tipoDato": 0,	
"nombreColumna": None,
"valores": None,
"clase": None,
"operador": 0,
"subGrupo": "filtro"
}
],
"canal": 0
})
headers = {
'Authorization': '$token',
'Content-Type': 'application/json'
}
conn.request("POST", "/api/v1/compra/listarDocumentoCompra", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))	

Put


import http.client
import json
conn = http.client.HTTPSConnection("api.worldoffice.cloud")
payload = json.dumps({
"id": 24305,
"fecha": "2023-07-15",
"prefijo": 1,
"documentoTipo": "FV",
"idEmpresa": 2,
"idTerceroExterno": 2946,
"idTerceroInterno": 3664,
"idFormaPago": 5,
"idMoneda": 31,
"trm": "1",
"porcentajeDescuento": True,
"porcentajeTodosRenglones": True,
"valDescuento": 0,
"reglones": [
{
"id": 38988,
"idInventario": 4517,
"unidadMedida": "doc",
"cantidad": "2",
"valorUnitario": "1000",
"idBodega": 1,
"porDescuento": 0,
"concepto": "hola nota primera"
},
{
"idInventario": 5,
"unidadMedida": "und",
"cantidad": "1",
"valorUnitario": "100000",
"idBodega": 1,
"porDescuento": 0,
"concepto": "televisor"	
}
],
"idDetalles": []
})
headers = {
'Content-Type': 'application/json',
'Authorization': '$token'
}
conn.request("PUT", "/api/v1/documentos/editarDocumentoVenta", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Delete


import http.client
import json
conn = http.client.HTTPSConnection("api.worldoffice.cloud")
payload = ''
headers = {
'Content-Type': 'application/json',
'Authorization': '$token'
}
conn.request("DELETE", "/api/v1/documentos/eliminar/23605", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

NODE

Get


var http = require('follow-redirects').http;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.worldoffice.cloud',
'path': '/api/v1/documentos/getDocumentoId/23440',
'headers': {
'Content-Type': 'application/json',
'Authorization': '$token'
},
'maxRedirects': 20
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());

});
res.on("error", function (error) {
console.error(error);
});
});
req.end();

Post


var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.worldoffice.cloud',
'path': '/api/v1/compra/listarDocumentoCompra',
'headers': {
'Authorization': '$token',
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"columnaOrdenar": "id",
"pagina": 0,
"registrosPorPagina": 1,
"orden": "ASC",
"filtros": [
{
"atributo": "documentoTipo.codigoDocumento",
"valor": "FC",
"valor2": null,
"tipoFiltro": 0,
"tipoDato": 0,
"nombreColumna": null,
"valores": null,
"clase": null,

"operador": 0,
"subGrupo": "filtro"
}
],
"canal": 0
});
req.write(postData);
req.end();

Put


var http = require('follow-redirects').http;
var fs = require('fs');
var options = {
'method': 'PUT',
'hostname': 'api.worldoffice.cloud',
'path': '/api/v1/documentos/editarDocumentoVenta',
'headers': {
'Content-Type': 'application/json',
'Authorization': '$token'
},
'maxRedirects': 20
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"id": 24305,
"fecha": "2023-07-15",
"prefijo": 1,
"documentoTipo": "FV",
"idEmpresa": 2,
"idTerceroExterno": 2946,
"idTerceroInterno": 3664,
"idFormaPago": 5,
"idMoneda": 31,
"trm": "1",
"porcentajeDescuento": true,
"porcentajeTodosRenglones": true,

"valDescuento": 0,
"reglones": [
{
"id": 38988,
"idInventario": 4517,
"unidadMedida": "doc",
"cantidad": "2",
"valorUnitario": "1000",
"idBodega": 1,
"porDescuento": 0,
"concepto": "hola nota primera"
},
{
"idInventario": 5,
"unidadMedida": "und",
"cantidad": "1",
"valorUnitario": "100000",
"idBodega": 1,
"porDescuento": 0,
"concepto": "televisor"
}
],
"idDetalles": []
});
req.write(postData);
req.end();

Delete


var http = require('follow-redirects').http;
var fs = require('fs');
var options = {
'method': 'DELETE',
'hostname': 'api.worldoffice.cloud',
'path': '/api/v1/documentos/eliminar/23605',
'headers': {
'Content-Type': 'application/json',
'Authorization': '$token'
},
'maxRedirects': 20
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});

res.on("error", function (error) {
console.error(error);
});
});
req.end();