Activation Get
This method allows you to check whether the Tax Communication automatic invoices communication service is currently active.
POST https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx
Sample Body
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/">
<soapenv:Header/>
<soapenv:Body>
<tax:ActivationGet>
<tax:authentication>
<tax:Email></tax:Email>
<tax:Token></tax:Token>
</tax:authentication>
</tax:ActivationGet>
</soapenv:Body>
</soapenv:Envelope>
Request
Header
| Parameter | Required | Value |
|---|---|---|
| Content-Type | required | text/xml |
Body
Authentication
| Parameter | Required | Description |
|---|---|---|
| required | string(50) The API user email with specific permission to configure this service into the company. | |
| Token | required | string(50) The token of the company that you are trying to check the Tax Communication service status. |
No additional parameters
This operation only requires authentication. No other parameters are needed.
Response
| Parameter | Description |
|---|---|
| RequestId | Unique Id for the request to have a way to identify the request |
| Type | string Description to inform if the request was a success or error. Example value: "Success" |
| Object | |
| IsActive | boolean Return if the Tax Communication service is active or not. Example value: "true" |
| ErrorMessage | string Unprocessed error message. |
| ErrorValue | MagniEnum |
| Value | int Identifies the error with a number. To identify the types of errors in more detail, click here. Example value: "1" |
| Name | string Identifies the error with a token. Example value: "AuthenticationError" |
Request Sample
Below you can check some examples of the SOAP request in some technologies.
cURL
curl --location --request POST 'https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx' \
--header 'Content-Type: text/xml' \
--data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/">
<soapenv:Header/>
<soapenv:Body>
<tax:ActivationGet>
<tax:authentication>
<tax:Email></tax:Email>
<tax:Token></tax:Token>
</tax:authentication>
</tax:ActivationGet>
</soapenv:Body>
</soapenv:Envelope>'
JavaScript (fetch)
var myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
var raw = `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/">
<soapenv:Header/>
<soapenv:Body>
<tax:ActivationGet>
<tax:authentication>
<tax:Email></tax:Email>
<tax:Token></tax:Token>
</tax:authentication>
</tax:ActivationGet>
</soapenv:Body>
</soapenv:Envelope>`;
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Node.js (axios)
var axios = require('axios');
var data = `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/">
<soapenv:Header/>
<soapenv:Body>
<tax:ActivationGet>
<tax:authentication>
<tax:Email></tax:Email>
<tax:Token></tax:Token>
</tax:authentication>
</tax:ActivationGet>
</soapenv:Body>
</soapenv:Envelope>`;
var config = {
method: 'post',
url: 'https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx',
headers: {
'Content-Type': 'text/xml'
},
data: data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python (requests)
import requests
url = "https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx"
headers = {
"Content-Type": "text/xml"
}
body = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/">
<soapenv:Header/>
<soapenv:Body>
<tax:ActivationGet>
<tax:authentication>
<tax:Email></tax:Email>
<tax:Token></tax:Token>
</tax:authentication>
</tax:ActivationGet>
</soapenv:Body>
</soapenv:Envelope>"""
response = requests.post(url, headers=headers, data=body)
print(response.text)
PHP (cURL)
<?php
$curl = curl_init();
$body = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://MagniAPI/TaxCommunication/">
<soapenv:Header/>
<soapenv:Body>
<tax:ActivationGet>
<tax:authentication>
<tax:Email></tax:Email>
<tax:Token></tax:Token>
</tax:authentication>
</tax:ActivationGet>
</soapenv:Body>
</soapenv:Envelope>';
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $body,
CURLOPT_HTTPHEADER => array(
'Content-Type: text/xml'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
C# (HttpClient)
using System.Net.Http;
using System.Text;
var client = new HttpClient();
var body = @"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:tax=""http://MagniAPI/TaxCommunication/"">
<soapenv:Header/>
<soapenv:Body>
<tax:ActivationGet>
<tax:authentication>
<tax:Email></tax:Email>
<tax:Token></tax:Token>
</tax:authentication>
</tax:ActivationGet>
</soapenv:Body>
</soapenv:Envelope>";
var content = new StringContent(body, Encoding.UTF8, "text/xml");
var response = await client.PostAsync("https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
Java (HttpURLConnection)
import java.io.*;
import java.net.*;
public class ActivationGet {
public static void main(String[] args) throws Exception {
URL url = new URL("https://bo.magnifinance.com/MagniAPI/taxcommunication.asmx");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "text/xml");
conn.setDoOutput(true);
String body = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tax=\"http://MagniAPI/TaxCommunication/\">"
+ " <soapenv:Header/>"
+ " <soapenv:Body>"
+ " <tax:ActivationGet>"
+ " <tax:authentication>"
+ " <tax:Email></tax:Email>"
+ " <tax:Token></tax:Token>"
+ " </tax:authentication>"
+ " </tax:ActivationGet>"
+ " </soapenv:Body>"
+ "</soapenv:Envelope>";
try (OutputStream os = conn.getOutputStream()) {
os.write(body.getBytes("UTF-8"));
}
try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
}
}
}
Example Response
Success
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ActivationGetResponse xmlns="http://MagniAPI/TaxCommunication/">
<ResponseActivationGet>
<RequestId>24f00a9d-dae6-472f-9dbe-ad32e8d181a2</RequestId>
<Type>Success</Type>
<Object>
<IsActive>true</IsActive>
</Object>
</ResponseActivationGet>
</ActivationGetResponse>
</soap:Body>
</soap:Envelope>
Error
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ActivationGetResponse xmlns="http://MagniAPI/TaxCommunication/">
<ResponseActivationGet>
<RequestId>5165e271-97ec-4425-aa33-f7c32c7c6f3d</RequestId>
<Type>Error</Type>
<ErrorValue>
<Value>1</Value>
<Name>AuthenticationError</Name>
</ErrorValue>
</ResponseActivationGet>
</ActivationGetResponse>
</soap:Body>
</soap:Envelope>