Activation Get (REST)
Checks whether the Tax Communication service is currently active for your company.
The service is reported as active only when automatic communication is switched on and the saved Tax Authority (AT) credentials are still accepted by the Tax Authority. The credentials are checked against the Tax Authority on every call, so if the AT password was changed or the user lost its permissions, this returns false.
Endpoint
GET https://bo.magnifinance.com/api/v2.1/taxCommunication/activationGet
Request
Header
| Parameter | Required | Value |
|---|---|---|
| required | string(50) The email of an API user with permission to check this service for the company. Example: api@yourcompany.pt | |
| Token | required | The subscription token of the company whose Tax Communication status you want to check. |
*These parameters must be HTTP headers within the request.
This operation only requires the authentication headers. It has no query string and no body.
Response
| Parameter | Description |
|---|---|
| RequestId | string Unique Id for the request to have a way to identify the request. It can be null on successful responses of this operation. |
| Type | int 0 = Success; 1 = Error. Example value: 0 |
| Object | Activation Only on success. |
| - IsActive | boolean Whether the Tax Communication service is active. Example value: true |
| - Username | string Always null in this response. |
| - Password | string Always null in this response. |
| ErrorValue | MagniEnum Only on errors. |
| - Value | int Identifies the error with a number. See Error Codes. Example value: 1 |
| - Name | string Identifies the error with a token. Example value: "AuthenticationError" |
| ErrorHumanReadable | string Text that explains the error found. |
| ValidationErrors | List of ValidationError Not used by this operation. |
| IsError | boolean Whether the request failed or not. Example value: false |
| IsSuccess | boolean Whether the request succeeded or not. Example value: true |
Errors
| ErrorValue | When |
|---|---|
AuthenticationError (1) | The email or token is wrong. |
GeneralUnknownError (3) | Something went wrong on our side. Try again later. |
SubscriptionExpired (5) | The company's subscription isn't active. |
WithoutPermission (31) | The API user doesn't have permission to check Tax Communication. |
If the Email or Token header is missing, the API answers HTTP 401 Unauthorized with no body.
Request Samples
Below you can check some examples of the REST request in some technologies.
cURL
curl --location --request GET 'https://bo.magnifinance.com/api/v2.1/taxCommunication/activationGet' \
--header 'email: api@yourcompany.pt' \
--header 'token: your-subscription-token'
JavaScript (fetch)
var myHeaders = new Headers();
myHeaders.append("email", "api@yourcompany.pt");
myHeaders.append("token", "your-subscription-token");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://bo.magnifinance.com/api/v2.1/taxCommunication/activationGet", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Node.js (axios)
var axios = require('axios');
var config = {
method: 'get',
url: 'https://bo.magnifinance.com/api/v2.1/taxCommunication/activationGet',
headers: {
'email': 'api@yourcompany.pt',
'token': 'your-subscription-token'
}
};
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/api/v2.1/taxCommunication/activationGet"
headers = {
"email": "api@yourcompany.pt",
"token": "your-subscription-token"
}
response = requests.get(url, headers=headers)
print(response.json())
PHP (cURL)
<?php
$ch = curl_init("https://bo.magnifinance.com/api/v2.1/taxCommunication/activationGet");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"email: api@yourcompany.pt",
"token: your-subscription-token"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
C# (HttpClient)
using System.Net.Http;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("email", "api@yourcompany.pt");
client.DefaultRequestHeaders.Add("token", "your-subscription-token");
var response = await client.GetAsync("https://bo.magnifinance.com/api/v2.1/taxCommunication/activationGet");
Console.WriteLine(await response.Content.ReadAsStringAsync());
Java (HttpClient)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://bo.magnifinance.com/api/v2.1/taxCommunication/activationGet"))
.header("email", "api@yourcompany.pt")
.header("token", "your-subscription-token")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Example Response
Success
{
"RequestId": null,
"Object": {
"Username": null,
"Password": null,
"IsActive": true
},
"Type": 0,
"ErrorValue": null,
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": true,
"IsError": false
}
Error
{
"RequestId": "5165e271-97ec-4425-aa33-f7c32c7c6f3d",
"Object": null,
"Type": 1,
"ErrorValue": {
"Value": 1,
"Name": "AuthenticationError"
},
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": false,
"IsError": true
}
For a complete list of error codes and their meanings, see the Error Codes page.