### Example Requests for Tags Distribution Endpoint Source: https://context7_llms Code examples demonstrating how to interact with the tags distribution endpoint using cURL (GET), JavaScript (PUT), and .NET (PUT). These examples show how to include necessary headers like 'accept' and 'Authorization'. Note the discrepancy where JavaScript and .NET examples use PUT instead of GET. ```bash curl -X 'GET' 'https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/tagsDistribution/day'\ -H 'accept: */*'\ -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/tagsDistribution/day`, { headers: { 'accept': '*/*', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}"); try { var response = await client.PutAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/tagsDistribution/day", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine($"Request error: {ex.Message}"); } } } ``` -------------------------------- ### GET Business Entity by Filter Examples Source: https://context7_llms Example requests demonstrating how to search for business entities using the GET /v1/config/business/entity endpoint. These examples include setting query parameters for filtering and pagination, and require an Authorization Bearer token. ```bash curl -X 'GET' 'https://api.iopole.com//v1/config/business/entity/search?q=name%3A%2A&limit=50' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/search?q=name%3A%2A&limit=50'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```.NET using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/config/business/entity/search?q=name%3A%2A&limit=50"; string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); try { HttpResponseMessage response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Request Examples: Get Invoice Status History Source: https://context7_llms Code examples demonstrating how to make a GET request to the /v1/invoice/{invoiceId}/status-history endpoint using cURL (Bash), Node.js with the 'got' library, and C# with HttpClient. These examples show how to include the 'accept' and 'Authorization' headers. ```bash curl -X 'GET' 'https://api.iopole.com//v1/invoice/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/status-history' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '32c9aec1-e6d6-4ddf-82a0-42dfa29268f8'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/${invoiceId}/status-history`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```csharp using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "32c9aec1-e6d6-4ddf-82a0-42dfa29268f8"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/invoice/{invoiceId}/status-history"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Example GET Requests to Search Invoices Source: https://context7_llms Illustrates how to programmatically make a GET request to the `/v1/invoice/search` endpoint with a sample query and authorization header using Bash, JavaScript, and .NET. ```bash curl -X 'GET' \ https://api.iopole.com//v1/invoice/search?q=invoice.buyer.name%3A%2A' \ -H 'accept: application/json' \ -H 'Authorization: Bearer ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const query = 'invoice.buyer.name:*'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/search?q=${encodeURIComponent(query)}`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var query = "invoice.buyer.name:*"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/invoice/search?q={Uri.EscapeDataString(query)}"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) {n Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Claim Business Entity Request Examples Source: https://context7_llms Code examples demonstrating how to send a GET request to claim a business entity using different programming languages and tools. ```bash curl -X 'GET' 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/claim' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/claim'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```.NET using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/claim"; string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); try { HttpResponseMessage response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Download Readable Invoice using GET /v1/invoice/{invoiceId}/download/readable Source: https://context7_llms Code example demonstrating how to download a readable invoice document using the GET /v1/invoice/{invoiceId}/download/readable endpoint. The example shows how to make the HTTP request and include necessary headers (accept, Authorization). Authentication via a Bearer token is required. ```bash curl -X 'GET' 'https://api.iopole.com//v1/invoice/5e80a8b6-06b5-4c52-853a-c5c2e252a2fc/download/readable' -H 'accept: application/pdf' -H 'Authorization: Bearer ${token}' ``` -------------------------------- ### Example Requests for Searching Business Entity by ID Source: https://context7_llms Provides code examples in Bash, JavaScript, and .NET for making a GET request to the /v1/config/business/entity/{businessEntityId} endpoint. These examples demonstrate how to include the Authorization header with a Bearer token. ```bash curl -X 'GET' 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```csharp using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8"; string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); try { HttpResponseMessage response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Example OAuth 2.0 Authorization Request HTTP GET Source: https://www.rfc-editor.org/rfc/rfc6749 An example HTTP GET request demonstrating how a client directs the user-agent to the authorization endpoint with the necessary parameters for an OAuth 2.0 authorization code flow. ```HTTP GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 Host: server.example.com ``` -------------------------------- ### Example API Request to Search International Directory Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/directory/readDirectoryIntSearch Provides code examples for making a GET request to the international directory search endpoint using different programming languages, including Bash, JavaScript, and .NET (C#). ```bash curl -X 'GET' 'https://api.iopole.com//v1/directory/fr/search?value=922304308&limit=50' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const value = '922304308'; const limit = 50; (async () => { try { const response = await got(`https://api.iopole.com//v1/directory?value=${value}&limit=${limit}`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```csharp using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var value = "922304308"; var limit = 50; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync($"https://api.iopole.com//v1/directory?value={value}&limit={limit}"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine($"Request error: {ex.Message}"); } } } ``` -------------------------------- ### Download Original Invoice using GET /v1/invoice/{invoiceId}/download Source: https://context7_llms Code examples demonstrating how to download an original invoice document using the GET /v1/invoice/{invoiceId}/download endpoint. The examples show how to make the HTTP request, include necessary headers (accept, Authorization), and handle the binary response to save the invoice as a PDF file. Authentication via a Bearer token is required. ```bash curl -X 'GET' 'https://api.iopole.com//v1/invoice/5e80a8b6-06b5-4c52-853a-c5c2e252a2fc/download' -H 'accept: application/pdf' -H 'Authorization: Bearer ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '5e80a8b6-06b5-4c52-853a-c5c2e252a2fc'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/${invoiceId}/download`, { headers: { 'accept': 'application/pdf', 'Authorization': `Bearer ${token}`, }, responseType: 'buffer', // Use buffer for binary data }); // Save the PDF to a file const fs = require('fs'); fs.writeFileSync('invoice.pdf', response); // Save response to invoice.pdf console.log('Invoice downloaded as invoice.pdf'); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.IO; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "5e80a8b6-06b5-4c52-853a-c5c2e252a2fc"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/pdf"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/invoice/{invoiceId}/download"); response.EnsureSuccessStatusCode(); var content = await response.Content.ReadAsByteArrayAsync(); await File.WriteAllBytesAsync("invoice.pdf", content); // Save the content to invoice.pdf Console.WriteLine("Invoice downloaded as invoice.pdf"); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Example Requests for Iopole Search by Filter API Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/operatorBusinessEntity/directory/searchBusinessEntityByFilter Demonstrates how to make a GET request to the 'Search by filter' endpoint using curl (bash) and JavaScript (using the 'got' library). These examples show how to include authentication and query parameters. ```bash curl -X 'GET' 'https://api.iopole.com//v1/config/business/entity/search?q=name%3A%2A&limit=50' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/search?q=name%3A%2A&limit=50'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` -------------------------------- ### Claim Business Entity API Request Examples Source: https://context7_llms Examples demonstrating how to make a request to the /v1/config/business/entity/scheme/:identifierScheme/value/:identifierValue/claim endpoint using different programming languages. Note: The API is described as a POST endpoint, but all provided code examples (curl, JavaScript, .NET) use GET. ```bash curl -X 'GET' \ 'https://api.iopole.com//v1/config/business/entity/scheme/0002/value/123456789/claim' \ -H 'accept: application/json' \ -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/scheme/0002/value/123456789/claim'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```csharp using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/config/business/entity/scheme/0002/value/123456789/claim"; string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); try { HttpResponseMessage response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Example API Requests for Messages Summary Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/stats/summary Demonstrates how to make requests to the messages summary endpoint using curl (bash), Node.js (javascript), and C# (.NET). Note that while the endpoint is a GET, the JavaScript and .NET examples provided in the source show a PUT operation. ```bash curl -X 'GET' https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/summary/day' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/summary/day`, { headers: { 'accept': '*/*', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", token); try { var response = await client.PutAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/summary/day", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine($"Request error: {ex.Message}"); } } } ``` -------------------------------- ### Example Iopole API Paginated Directory Request Source: https://docs.iopole.com/docs/iopole-api/pagination Demonstrates how to construct a paginated GET request to the Iopole /v1/directory endpoint using `offset` and `limit` query parameters across different programming languages. ```JavaScript const got = require('got'); const directoryArray = await got.get('https://api.iopole.com//v1/directory?value=IOPOLE&offset=5000&limit=50',).json(); ``` ```bash curl -X GET "https://api.iopole.com//v1/directory?value=IOPOLE&offset=5000&limit=50" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; using Newtonsoft.Json.Linq; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/directory?value=IOPOLE&offset=5000&limit=50"; using (HttpClient client = new HttpClient()) { HttpResponseMessage response = await client.GetAsync(url); if (response.IsSuccessStatusCode) { string responseString = await response.Content.ReadAsStringAsync(); JArray directoryArray = JArray.Parse(responseString); Console.WriteLine(directoryArray); } else { Console.WriteLine("Error: " + response.StatusCode); } } } } ``` -------------------------------- ### Example Requests for Iopole Get Sent Messages API Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/stats/messageSent These code examples demonstrate how to call the Iopole 'Messages sent' API endpoint using different programming languages. Each example shows how to construct the GET request, include necessary headers like 'Authorization', and handle the API response. ```bash curl -X 'GET' 'https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesSent/day' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; (async () => { try { const response = await got.get(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesSent/day`, { headers: { 'accept': '*/*', 'Authorization': `Bearer ${token}` }, responseType: 'json' }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesSent/day"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine($"Request error: {ex.Message}"); } } } ``` -------------------------------- ### Example HTTP GET Request for OAuth 2.0 Implicit Grant Authorization Source: https://www.rfc-editor.org/rfc/rfc6749 An illustrative example of an HTTP GET request used by the client to direct the user-agent to the authorization endpoint for the OAuth 2.0 Implicit Grant Flow, including all necessary parameters. ```HTTP GET /authorize?response_type=token&client_id=s6BhdRkqt3&state=xyz &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb HTTP/1.1 Host: server.example.com ``` -------------------------------- ### Bash cURL Example for Messages Distribution API Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/stats/distribution Demonstrates how to make a GET request to the 'Messages distribution' API using cURL. The example includes setting the 'accept' and 'Authorization' headers with a placeholder token. ```bash curl -X 'GET' https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/tagsDistribution/day' -H 'accept: */*' -H 'Authorization: ${token}' ``` -------------------------------- ### Iopole Search API Wildcard Search Examples Source: https://context7_llms Demonstrates how to perform wildcard searches in the iopole Search API. Examples include matching values that start with a string and values that contain a specific substring using the Lucene-like query syntax. ```Lucene-like Query name:val* Return truthy if `name` start by string `val` name:"*val48*" Return truthy if `name` contains `val48` ``` -------------------------------- ### Code Examples: Register Business Entity into Network by ID Source: https://context7_llms Practical code examples demonstrating how to call the 'Register Business Entity into Network by ID' API endpoint using different programming languages. ```bash curl -X 'POST' 'https://api.iopole.com//v1/config/business/entity/identifier/0194cbfe-ab2b-709e-8897-e1b86eca130e/network/DOMESTIC_FR' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' -H 'Content-Type: application/json' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/identifier/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/network/DOMESTIC_FR'; const token = 'your_token_here'; (async () => { try { const response = await got.post(url, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, json: {} }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```.net using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/config/business/entity/identifier/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/network/DOMESTIC_FR"; string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); try { HttpResponseMessage response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Retrieve Last Errors API Call Examples Source: https://context7_llms Code examples for calling the /v1/stats/{network}/lastErrors API. These snippets demonstrate how to pass the 'network' path parameter and an authorization token. Note: The JavaScript and .NET examples incorrectly use HTTP PUT instead of GET. ```bash curl -X 'GET' https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/lastErrors' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/lastErrors`, { headers: { 'accept': '*/*', 'Authorization': Bearer `${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", {token}); try { var response = await client.PutAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/lastErrors", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Download Invoice using Node.js (JavaScript) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/downloadInvoice Node.js example demonstrating how to download an invoice PDF using the 'got' library. It sends a GET request with appropriate headers, saves the binary response to a file, and handles potential errors. ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '5e80a8b6-06b5-4c52-853a-c5c2e252a2fc'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/${invoiceId}/download`, { headers: { 'accept': 'application/pdf', 'Authorization': `Bearer ${token}`, }, responseType: 'buffer', // Use buffer for binary data }); // Save the PDF to a file const fs = require('fs'); fs.writeFileSync('invoice.pdf', response); // Save response to invoice.pdf console.log('Invoice downloaded as invoice.pdf'); } catch (error) { console.error(error.response.body); } })(); ``` -------------------------------- ### Mark Invoice as Seen API Request Examples Source: https://context7_llms Code examples demonstrating how to make a PUT request to the 'Mark invoice as seen' API endpoint using different programming languages. These examples require an authorization token and the specific invoice ID. ```bash curl -X 'PUT' 'https://api.iopole.com//v1/invoice/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/markAsSeen' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/invoice/${invoiceId}/markAsSeen`, { headers: { 'accept': '*/*', 'Authorization': Bearer `${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.net using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", {token}); try { var response = await client.PutAsync("https://api.iopole.com//v1/invoice/{invoiceId}/markAsSeen", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Search Invoices by Filter Code Examples Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/searchInvoiceByFilter/ Practical code examples demonstrating how to interact with the Iopole invoice search API. Includes a Bash curl command and a JavaScript example using the 'got' library to perform a filtered search for invoices. ```bash curl -X 'GET' https://api.iopole.com//v1/invoice/search?q=invoice.buyer.name%3A%2A' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const query = 'invoice.buyer.name:*'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/search?q=${encodeURIComponent(query)}`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` -------------------------------- ### Example API Calls for Iopole Invoice Search Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/searchInvoiceByFilter Demonstrates how to make a GET request to the /v1/invoice/search endpoint using Bash cURL and JavaScript (with 'got' library), including setting the 'Authorization' header and encoding query parameters. ```bash curl -X 'GET' https://api.iopole.com//v1/invoice/search?q=invoice.buyer.name%3A%2A' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const query = 'invoice.buyer.name:*'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/search?q=${encodeURIComponent(query)}`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` -------------------------------- ### Mark Invoice Status as Seen Examples Source: https://context7_llms Code examples demonstrating how to call the PUT /v1/invoice/status/{statusId}/markAsSeen API endpoint using Bash, JavaScript, and .NET. An authorization token is required for all requests. ```bash curl -X 'PUT' 'https://api.iopole.com//v1/invoice/status/3fa85f64-5717-4562-b3fc-2c963f66afa6/markAsSeen' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const statusId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/invoice/status/${statusId}/markAsSeen`, { headers: { 'accept': '*/*', 'Authorization': token, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var statusId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", token); try { var response = await client.PutAsync("https://api.iopole.com//v1/invoice/status/${statusId}/markAsSeen", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Download Invoice using .NET (C#) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/downloadInvoice C# example demonstrating how to download an invoice PDF using HttpClient. It configures request headers, sends a GET request, reads the response as a byte array, and saves it to a file, including error handling. ```.NET using System; using System.IO; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "5e80a8b6-06b5-4c52-853a-c5c2e252a2fc"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/pdf"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/invoice/{invoiceId}/download"); response.EnsureSuccessStatusCode(); var content = await response.Content.ReadAsByteArrayAsync(); await File.WriteAllBytesAsync("invoice.pdf", content); // Save the content to invoice.pdf Console.WriteLine("Invoice downloaded as invoice.pdf"); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### API Response Example: 201 Created Webhook Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/webhook/createWebhook An example JSON payload returned upon successful creation of a webhook, illustrating the `type` and `id` fields. ```json { "type": "WEBHOOK", "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } ``` -------------------------------- ### OAuth2 Client Credentials Configuration Example Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/webhook/webhookObject/ An example JSON snippet demonstrating the structure for configuring OAuth2 client credentials, including the callback URL, client ID, and client secret. ```JSON { "oauth2ClientCredentials": { "callbackUrl": "https://myauthorizationServer.com/auth", "clientId": "myClientId", "clientSecret": "myClientSecret" } } ``` -------------------------------- ### Search French Directory using C# (.NET HttpClient) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/directory/readDirectoryFrSearch C# example demonstrating how to use HttpClient to send a GET request to the French directory search API, including setting headers and handling potential HTTP request exceptions. ```csharp using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var limit = 50; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/directory/fr/search?q=name:*&limit={limit}"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Claim Business Entity by Identifier using JavaScript (got) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/operatorBusinessEntity/claim/claimByIdentifier JavaScript example using the 'got' library to send a request (note: API documentation specifies POST, example uses GET URL) to claim a business entity by its identifier. The snippet demonstrates how to set headers for content type and authorization, and includes basic error handling. ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/scheme/0002/value/123456789/claim'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` -------------------------------- ### Retrieve Not Seen Invoices Request Source: https://context7_llms Code examples for making a GET request to retrieve all invoices that have not yet been marked as seen. ```bash curl -X 'GET' 'https://api.iopole.com//v1/invoice/notSeen' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/notSeen`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/invoice/notSeen"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Search French Directory using Node.js (got) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/directory/readDirectoryFrSearch JavaScript example using the 'got' library to make an asynchronous GET request to the French directory search API, handling success and error responses. ```javascript const got = require('got'); const token = 'your_token_here'; const limit = 50; (async () => { try { const response = await got(`https://api.iopole.com//v1/directory/fr/search?q=name:*&limit=${limit}`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` -------------------------------- ### Search API: Wildcard Searches Source: https://docs.iopole.com/docs/iopole-api/search/ Demonstrates how to perform pattern matching within queries using wildcards. Examples include checking if a field starts with a specific string or contains a substring. ```APIDOC Wildcard Searches: - Starts with: `name:val*` (Returns truthy if `name` starts with string `val`) - Contains: `name:"*val48*"` (Returns truthy if `name` contains `val48`) ``` -------------------------------- ### Example 201 Response for Created Business Entity Source: https://context7_llms An example JSON response showing the successful creation of a business entity and its identifier, including their types and unique IDs. ```json [ { "type": "BUSINESS_ENTITY", "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479" }, { "type": "BUSINESS_ENTITY_IDENTIFIER", "id": "a67ac10b-58cc-4372-a567-0e02b2c3d123" } ] ``` -------------------------------- ### Curl Example: Download Iopole Readable Invoice Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/downloadReadable This curl command demonstrates how to make a GET request to the Iopole API to download a readable invoice. It includes setting the `Accept` header for PDF content and providing a bearer token for authorization. ```shell curl -X 'GET' 'https://api.iopole.com//v1/invoice/5e80a8b6-06b5-4c52-853a-c5c2e252a2fc/download/readable' -H 'accept: application/pdf' -H 'Authorization: Bearer ${token}' ``` -------------------------------- ### Remove Identifier API Call Examples Source: https://context7_llms Practical code examples demonstrating how to make a DELETE request to the Remove Identifier API endpoint. Examples are provided for `curl` (bash), `Node.js` using the 'got' library, and `C#` using `HttpClient`, all illustrating how to include the necessary 'Authorization' and 'Accept' headers. ```bash curl -X 'DELETE' 'https://api.iopole.com//v1/config/business/entity/identifier/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/identifier/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8'; const token = 'your_token_here'; (async () => { try { const response = await got.delete(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```.NET using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); try { var response = await client.DeleteAsync("https://api.iopole.com//v1/config/business/entity/identifier/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8"); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Create Business Entity Identifier via API Source: https://context7_llms These code examples demonstrate how to create a new identifier for a business entity using the POST /v1/config/business/entity/{businessEntityId}/identifier endpoint. They show how to include authentication tokens and the request body containing identifier details like type, scheme, value, and optional business card information. Note: The Bash example incorrectly uses GET verb but includes a request body. ```bash curl -X 'GET' 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/identifier' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' -d '{ "type": "ROUTING_CODE", "scheme": "0224", "value": "Service A", "businessCard": { "countrySubdivision": "Herault", "city": "Montpellier", "postalCode": "34000", "addressLine1": "line 1", "addressLine2": "line 2", "addressLine3": "line 3" } }' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/identifier'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, json: { "type": "ROUTING_CODE", "scheme": "0224", "value": "Service A", "businessCard": { "countrySubdivision": "Herault", "city": "Montpellier", "postalCode": "34000", "addressLine1": "line 1", "addressLine2": "line 2", "addressLine3": "line 3" } }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```csharp using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var jsonContent = "{\"name\": \"IOPOLE Belgique Namur\",\"country\": \"BE\",\"scope\": \"PRIVATE_TAX_PAYER\",\"identifierScheme\": \"0193\",\"identifierValue\": \"51144456707865\",\"businessCard\": {\"city\": \"Namur\",\"postalCode\": 1000,\"addressLine1\": \"line 1\",\"addressLine2\": \"line 2\",\"addressLine3\": \"line 3\"}"; var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { var response = await client.PostAsync("https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/identifier", content); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Fetch Paginated Data from Iopole API Source: https://docs.iopole.com/docs/iopole-api/pagination/ Illustrates how to make a paginated GET request to the Iopole API's directory endpoint using `offset` and `limit` parameters. Examples are provided for JavaScript, bash, and .NET. ```JavaScript const got = require('got'); const directoryArray = await got.get('https://api.iopole.com//v1/directory?value=IOPOLE&offset=5000&limit=50',).json(); ``` ```bash curl -X GET "https://api.iopole.com//v1/directory?value=IOPOLE&offset=5000&limit=50" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; using Newtonsoft.Json.Linq; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/directory?value=IOPOLE&offset=5000&limit=50"; using (HttpClient client = new HttpClient()) { HttpResponseMessage response = await client.GetAsync(url); if (response.IsSuccessStatusCode) { string responseString = await response.Content.ReadAsStringAsync(); JArray directoryArray = JArray.Parse(responseString); Console.WriteLine(directoryArray); } else { Console.WriteLine("Error: " + response.StatusCode); } } } } ``` -------------------------------- ### Example JSON Response for Directory Search Source: https://context7_llms An example JSON response demonstrating the structure of data returned from directory search endpoints, including multiple directory entries with detailed attributes and nested objects. ```JSON { "data": [ { "businessEntityId": "0194cbfd-5d5d-7388-bb3c-3e2df476eca9", "name": "HELIO PROJETS", "type": "LEGAL_UNIT", "scope": "PRIVATE_TAX_PAYER", "country": "FR", "identifierScheme": "0002", "identifierValue": "007350101", "countryIdentifier": { "siren": "007350101" }, "identifiers": [ { "businessEntityIdentifierId": "0194cbfd-5d61-774e-9c9f-810ccf54b156", "type": "LEGAL_IDENTIFIER", "scheme": "0002", "value": "007350101", "networkRegistered": [ { "directoryId": "0194cc00-9331-7057-a32e-69111f02fbe5", "networkId": "b00d52d5-40b8-4d71-83f1-1709cf47e812", "directoryAddress": "0225:007350101", "networkIdentifier": "DOMESTIC_FR", "validFrom": "2024-01-01" } ] } ] }, { "businessEntityId": "0194cbfd-7042-7046-8bab-5f8ae49a0628", "name": "HELIANTHE", "type": "LEGAL_UNIT", "scope": "PRIVATE_TAX_PAYER", "country": "FR", "identifierScheme": "0002", "identifierValue": "351881800", "countryIdentifier": { "siren": "351881800" }, "identifiers": [ { "businessEntityIdentifierId": "0194cbfd-7043-758a-b9da-bb3a84897d43", "type": "LEGAL_IDENTIFIER", "scheme": "0002", "value": "351881800", "networkRegistered": [ { "directoryId": "0194cc00-a52c-7251-8f30-8eafdf1f66ec", "networkId": "b00d52d5-40b8-4d71-83f1-1709cf47e812", "directoryAddress": "0225:351881800", "networkIdentifier": "DOMESTIC_FR", "validFrom": "2024-01-01" } ] } ] }, { "businessEntityId": "0194cbff-11d7-777e-bbd5-da801296805b", "name": "HELOISE", "type": "OFFICE", "scope": "PRIMARY", "country": "FR", "identifierScheme": "0009", "identifierValue": "43786239400024", "countryIdentifier": { "siren": "437862394", "siret": "43786239400024" }, "postalAddress": { "city": "MONTPELLIER", "postalCode": "34000", "addressLine1": "RUE DE GALATA" }, "legalUnit": { "businessEntityId": "0194cbfd-9f53-74e3-9907-99c877f7fb0a", "name": "HELOISE" }, "identifiers": [ { "businessEntityIdentifierId": "0194cbff-11d8-753e-b6cf-e1c7d8b0f313", "type": "OFFICE_IDENTIFIER", "scheme": "0009", "value": "43786239400024" } ] } ], "meta": { "offset": 0, "limit": 50, "count": 3 } } ``` -------------------------------- ### Common Invoice Search Query Examples Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/searchInvoiceByFilter/ Provides practical examples of query strings for the Iopole Invoice Search API, illustrating how to filter invoices by state, date range, direction, and buyer details. ```Query Language Give me all invoice not yet delivered invoiceState:DELIVERY_PENDING Give me all invoices delivered between 2023-07-31 11:07:04 and 2024-08-01 01:07:04 invoice.deliveryState:DELIVERED AND (invoice.createdDate:>"2023-07-31 11:07:04" AND invoice.createdDate:<="2024-08-01 01:07:04") Give me only received invoice invoice.direction:INBOUND Give me buyer with corporate name that starts by ART or siret containing 123456789 invoice.buyer.name:ART* OR invoice.buyer.siret:*123456789* ``` -------------------------------- ### Example Request to Create Office Source: https://context7_llms Demonstrates how to make a POST request to the /v1/config/business/entity/office endpoint to create a new office, including required headers and a sample JSON body, provided in Bash, JavaScript, and .NET. ```bash curl -X 'POST' 'https://api.iopole.com//v1/config/business/entity/office' -H 'accept: application/json' -H 'Content-Type: application/json' -H 'Authorization: Bearer ${TOKEN}' -d '{ "name": "IOPOLE Belgique Namur", "country": "BE", "scope": "PRIMARY", "identifierScheme": "0193", "identifierValue": "51144456707865", "businessCard": { "city": "Namur", "postalCode": 1000, "addressLine1": "line 1", "addressLine2": "line 2", "addressLine3": "line 3" } }' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/office'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, json: { "name": "IOPOLE Belgique Namur", "country": "BE", "scope": "PRIVATE_TAX_PAYER", "identifierScheme": "0193", "identifierValue": "51144456707865", "businessCard": { "city": "Namur", "postalCode": 1000, "addressLine1": "line 1", "addressLine2": "line 2", "addressLine3": "line 3" } }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```.NET using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var jsonContent = "{\"name\": \"IOPOLE Belgique namur\",\"country\": \"BE\",\"scope\": \"PRIVATE_TAX_PAYER\",\"identifierScheme\": \"0208\",\"identifierValue\": \"0114445670\", \"businessCard\": {\"city\": \"Namur\",\"postalCode\": 1000,\"addressLine1\": \"line 1\",\"addressLine2\": \"line 2\",\"addressLine3\": \"line 3\"}}"; var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { var response = await client.PostAsync("https://api.iopole.com//v1/config/business/entity/office", content); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Minimalist Invoice JSON Structure Example Source: https://context7_llms A basic JSON example demonstrating the core structure of an invoice object, including buyer, seller, tax details, and monetary information, aligned with EN16931 standard. ```json { "type": 380, "processType": "B1", "invoiceId": "INV20240918-001", "invoiceDate": "2024-09-18", "invoiceDueDate": "2024-10-18", "buyer": { "name": "Example Buyer", "country": "FR", "siren": "987654321", "postalAddress": { "addressLineOne": "456 Buyer Avenue", "cityName": "Paris", "postalCode": "75002", "country": "FR" } }, "seller": { "name": "Example Seller", "country": "FR", "siren": "123456789", "postalAddress": { "addressLineOne": "123 Seller Street", "cityName": "Paris", "postalCode": "75001", "country": "FR" } }, "taxDetails": [ { "taxableAmount": { "amount": 1000 }, "taxAmount": { "amount": 200 }, "taxType": "VAT", "categoryCode": "S", "percent": 20 } ], "monetary": { "invoiceAmount": { "amount": 1200 }, "taxBasisTotalAmount": { "amount": 1000 }, "taxTotalAmount": { "amount": 200, "currency": "EUR" }, "payableAmount": { "amount": 1200 }, "lineTotalAmount": { "amount": 1000 }, "invoiceCurrency": "EUR" } } ``` -------------------------------- ### Basic Invoice JSON Example without Line Items Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/InvoiceObject A partial JSON example demonstrating a basic invoice structure without detailed line items, providing essential header information for an invoice. ```JSON { "type": 380, "processType": "B1", "invoiceId": "F20220031", ``` -------------------------------- ### Mark Invoice Status as Seen API Call Examples Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/status/markStatusAsSeen Examples demonstrating how to send a PUT request to the 'markAsSeen' endpoint using different programming languages, requiring an authorization token. ```bash curl -X 'PUT' 'https://api.iopole.com//v1/invoice/status/3fa85f64-5717-4562-b3fc-2c963f66afa6/markAsSeen' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const statusId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/invoice/status/${statusId}/markAsSeen`, { headers: { 'accept': '*/*', 'Authorization': token, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System;using System.Net.Http;using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var statusId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", token); try { var response = await client.PutAsync("https://api.iopole.com//v1/invoice/status/${statusId}/markAsSeen", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Example: Issuing an Invoice via POST /v1/invoice Source: https://context7_llms Demonstrates how to send an invoice file to the /v1/invoice endpoint using multipart/form-data. Authentication via a Bearer token is required. The examples show how to attach a PDF file. ```bash curl -X 'POST' https://api.iopole.com//v1/invoice' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' -H 'Content-Type: multipart/form-data' -F 'file=@F20240610-2111-002.cii.xml.pdf;type=application/pdf' ``` ```javascript const got = require('got'); const FormData = require('form-data'); const fs = require('fs'); const token = 'your_token_here'; (async () => { try { const form = new FormData(); form.append('file', fs.createReadStream('F20240610-2111-002.cii.xml.pdf'), { contentType: 'application/pdf', }); const response = await got.post('https://api.iopole.com//v1/invoice', { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, ...form.getHeaders() // Add the form headers }, body: form, responseType: 'json' }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.IO; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var filePath = "F20240610-2111-002.cii.xml.pdf"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); using var form = new MultipartFormDataContent(); using var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); using var fileContent = new StreamContent(fileStream); fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/pdf"); form.Add(fileContent, "file", Path.GetFileName(filePath)); try { var response = await client.PostAsync("https://api.iopole.com//v1/invoice", form); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### OAuth 2.0 Access Token Request Example Source: https://www.rfc-editor.org/rfc/rfc6749 An example HTTP POST request made by the client to the token endpoint to exchange an authorization code for an access token. ```HTTP POST /token HTTP/1.1 ``` -------------------------------- ### Request Examples: Get Received Messages Statistics Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/stats/messageReceived Code examples demonstrating how to make a GET request to the Iopole API to retrieve the number of received messages for a specific time interval. Requires an authorization token. ```bash curl -X 'GET' https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesReceived/day' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesReceived/day`, { headers: { 'accept': '*/*', 'Authorization': Bearer `${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", {token}); try { var response = await client.PutAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesReceived/day", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Retrieve Success/Error Stats API Request Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/stats/messageSuccessError Examples for making a GET request to the successErrors API endpoint, requiring an Authorization token. Note: The original JavaScript and .NET examples incorrectly use PUT instead of GET. ```bash curl -X 'GET' https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/successErrors/day' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/successErrors/day`, { headers: { 'accept': '*/*', 'Authorization': Bearer `${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", {token}); try { var response = await client.PutAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/successErrors/day", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Invoice Search Query String Examples Source: https://context7_llms Illustrative examples of `q` parameter values for the `/v1/invoice/search` endpoint, demonstrating how to filter invoices based on various criteria such as delivery state, creation date ranges, direction, and buyer details. ```APIDOC // Give me all invoice not yet delivered invoiceState:DELIVERY_PENDING // Give me all invoices delivered between 2023-07-31 11:07:04 and 2024-08-01 01:07:04 invoice.deliveryState:DELIVERED AND (invoice.createdDate:>"2023-07-31 11:07:04" AND invoice.createdDate:<="2024-08-01 01:07:04") // Give me only received invoice invoice.direction:INBOUND // Give me buyer with corporate name that starts by ART or siret containing 123456789 invoice.buyer.name:ART* OR invoice.buyer.siret:*123456789* ``` -------------------------------- ### iopole API Search Query Examples Source: https://context7_llms Demonstrates various search query syntaxes for the iopole API, including wildcard searches, date range expressions, and logical operators for combining conditions on fields like 'buyer.siren', 'seller.siren', 'buyer.corporateName', 'seller.corporateName', and 'createdDate'. ```Query Language buyer.siren:"*123456789" OR seller.siren:"*88888" ``` ```Query Language createdDate:>"2024-01-01 04:05:06" AND createdDate:<"2025-01-01 04:05:06" ``` ```Query Language buyer.siren:"*123456789" AND (buyer.corporateName:iopole OR seller.corporateName:"myOtherCompany") AND createdDate:>="2024-01-01" AND createdDate:<="2025-01-01")' ``` -------------------------------- ### Example Request: Create Business Entity Identifier (curl) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/operatorBusinessEntity/manage/identifier/createIdentifier Demonstrates how to make a request to create a new identifier for a business entity using a curl command. Note: The example uses a GET method with a request body, which is typically incorrect for GET requests. ```bash curl -X 'GET' 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8/identifier' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' -d '{ "type": "ROUTING_CODE", "scheme": "0224", "value": "Service A", "businessCard": { "countrySubdivision": "Herault", "city": "Montpellier", "postalCode": "34000", "addressLine1": "line 1", "addressLine2": "line 2", "addressLine3": "line 3" } }' ``` -------------------------------- ### Curl Example: Get Retry Strategy API Request Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/webhook/retryStrategy/getRetryStrategy Illustrates how to make a GET request to the Iopole API's retry strategy endpoint using `curl`, including the necessary `Authorization` and `Content-Type` headers. ```curl curl -X 'GET' 'https://api.iopole.com//v1/config/webhook/retryStrategy' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' -H 'Content-Type: application/json' ``` -------------------------------- ### Example Requests for Message Error Statistics API Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/stats/messageErrors Provides code examples in Bash, JavaScript, and .NET for making a GET request to the /v1/stats/{network}/messagesError/{interval} endpoint to retrieve message error statistics. These examples demonstrate how to include the authorization token and handle the response. ```bash curl -X 'GET' https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesError/day' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesError/day`, { headers: { 'accept': '*/*', 'Authorization': Bearer `${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", {token}); try { var response = await client.PutAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/messagesError/day", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### JavaScript Example for Messages Distribution API (got library) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/stats/distribution Provides an asynchronous JavaScript example using the 'got' library to interact with the 'Messages distribution' API. It sets necessary headers and includes basic error handling. ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/tagsDistribution/day`, { headers: { 'accept': '*/*', 'Authorization': Bearer `${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` -------------------------------- ### Retrieve Success and Error Counts via API Source: https://context7_llms Demonstrates how to make an API call to the `/v1/stats/{network}/successErrors/{interval}` endpoint to retrieve aggregated success and error statistics. Examples are provided for Bash (curl), JavaScript (got library), and .NET (HttpClient). Note: The JavaScript and .NET examples incorrectly use PUT instead of GET, but the endpoint is defined as GET. ```bash curl -X 'GET' https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/successErrors/day' -H 'accept: */*' -H 'Authorization: ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52'; (async () => { try { const response = await got.put(`https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/successErrors/day`, { headers: { 'accept': '*/*', 'Authorization': Bearer `${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.net using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", {token}); try { var response = await client.PutAsync("https://api.iopole.com//v1/stats/9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52/successErrors/day", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Mark Invoice as Seen using .NET (C#) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/markInvoiceAsSeen C# example demonstrating how to use `HttpClient` to send a PUT request to the `markAsSeen` endpoint. It includes setting request headers and handling potential `HttpRequestException`. ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "9ca2d4fa-0708-4cf5-85ca-cb2cf2eced52"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "*/*"); client.DefaultRequestHeaders.Add("Authorization", token); try { var response = await client.PutAsync("https://api.iopole.com//v1/invoice/" + invoiceId + "/markAsSeen", null); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine($"Request error: {ex.Message}"); } } } ``` -------------------------------- ### Search Business Entity by ID using GET Request Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/operatorBusinessEntity/directory/searchBusinessEntityById Code examples demonstrating how to make a GET request to the /v1/config/business/entity/{businessEntityId} endpoint using bash, JavaScript, and .NET to search for a business entity by its ID. ```bash curl -X 'GET' 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```.NET using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { string url = "https://api.iopole.com//v1/config/business/entity/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8"; string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); try { HttpResponseMessage response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine("Error: {e.Message}"); } } } ``` -------------------------------- ### Search Invoice by ID using GET Request Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/invoice/searchInvoiceById Example code snippets demonstrating how to make a GET request to the Iopole API to search for an invoice by its ID using Bash (curl), JavaScript (got library), and .NET (HttpClient). ```bash curl -X 'GET' 'https://api.iopole.com//v1/invoice/32c9aec1-e6d6-4ddf-82a0-42dfa29268f8' -H 'accept: application/json' -H 'Authorization: Bearer ${TOKEN}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; const invoiceId = '32c9aec1-e6d6-4ddf-82a0-42dfa29268f8'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/${invoiceId}`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; var invoiceId = "32c9aec1-e6d6-4ddf-82a0-42dfa29268f8"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/invoice/{invoiceId}"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### cURL Example: Create Webhook with Sample Data Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/webhook/createWebhook A practical cURL command demonstrating how to send a POST request to the `/v1/config/webhook` endpoint. It includes necessary headers for authentication and content type, along with a sample JSON payload for webhook configuration. ```curl curl -X 'POST' 'https://api.iopole.com//v1/config/webhook' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' -H 'Content-Type: application/json' -d '{ "label": "My simple webhook configuration", "adapterCode": "standardAdapter", "interopData": { "endpoints": { "status": { "callbackUrl": "https://myenpoint.com/status" }, "invoice": { "callbackUrl": "https://myenpoint.com/invoice" } } }}' ``` -------------------------------- ### Example Requests to Create Legal Unit Source: https://context7_llms Example requests to create a new legal unit using the POST /v1/config/business/entity/legalUnit endpoint. Requires an admin role and a bearer token for authentication. The request body specifies the legal unit's name, country, scope, identifier scheme, and identifier value. ```bash curl -X 'POST' 'https://api.iopole.com//v1/config/business/entity/legalUnit' -H 'accept: application/json' -H 'Content-Type: application/json' -H 'Authorization: Bearer ${TOKEN}' -d '{ "name": "IOPOLE Belgique", "country": "BE", "scope": "PRIVATE_TAX_PAYER", "identifierScheme": "0208", "identifierValue": "0114445670" }' ``` ```javascript const got = require('got'); const url = 'https://api.iopole.com//v1/config/business/entity/legalUnit'; const token = 'your_token_here'; (async () => { try { const response = await got(url, { headers: { accept: 'application/json', Authorization: `Bearer ${token}`, }, json: { "name": "IOPOLE Belgique", "country": "BE", "scope": "PRIVATE_TAX_PAYER", "identifierScheme": "0208", "identifierValue": "0114445670" }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error('Error:', error.message); } })(); ``` ```.NET using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using System.Text; class Program { static async Task Main(string[] args) { string token = "your_token_here"; using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var jsonContent = "{\"name\": \"IOPOLE Belgique\",\"country\": \"BE\",\"scope\": \"PRIVATE_TAX_PAYER\",\"identifierScheme\": \"0208\",\"identifierValue\": \"0114445670\"}"; var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { var response = await client.PostAsync("https://api.iopole.com//v1/config/business/entity/legalUnit", content); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException e) { Console.WriteLine($"Error: {e.Message}"); } } } ``` -------------------------------- ### Retrieve Not Seen Invoice Status with GET Request Source: https://context7_llms Demonstrates how to fetch unseen invoice statuses using a GET request to `/v1/invoice/status/notSeen`. Examples are provided for Bash, JavaScript, and .NET, all requiring a bearer token for authorization and expecting a JSON response. ```bash curl -X 'GET' 'https://api.iopole.com//v1/invoice/status/notSeen' -H 'accept: application/json' -H 'Authorization: Bearer ${token}' ``` ```javascript const got = require('got'); const token = 'your_token_here'; (async () => { try { const response = await got(`https://api.iopole.com//v1/invoice/status/notSeen`, { headers: { 'accept': 'application/json', 'Authorization': `Bearer ${token}`, }, responseType: 'json', }); console.log(response.body); } catch (error) { console.error(error.response.body); } })(); ``` ```.NET using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main(string[] args) { var token = "your_token_here"; using var client = new HttpClient(); client.DefaultRequestHeaders.Add("accept", "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer ${token}"); try { var response = await client.GetAsync("https://api.iopole.com//v1/invoice/status/notSeen"); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } catch (HttpRequestException ex) { Console.WriteLine("Request error: {ex.Message}"); } } } ``` -------------------------------- ### Example JSON for Head Office (Siret) Source: https://docs.iopole.com/docs/iopole-api/apiDescriptions/directory/readDirectoryFrSearch Demonstrates the JSON representation of a head office, detailing its Siret number, postal address, associated legal unit, and identifiers. ```JSON { "data": [ { "businessEntityId": "0193acea-5d3b-7665-ada5-8441740e0b68", "name": "Head Office 1", "type": "OFFICE", "scope": "PRIMARY", "siren": "007350101", "siret": "00735010100015", "postalAddress": { "city": "city_1", "postalCode": "34000", "addressLine1": "addr1_1", "addressLine2": "addr2_1" }, "legalUnit": { "businessEntityId": "0193acea-5d3a-7665-ada5-64ffee5ab779", "name": "Legal unit Example 1", "siren": "007350101" }, "identifiers": [ { "businessEntityIdentifierId": "0193acea-5d3b-7665-ada5-8d5120d8e70b", "type": "OFFICE_IDENTIFIER", "scheme": "0009", "value": "00735010100015", "networkRegistered": [ { "directoryId": "0123c00e-1d01-7136-a979-7c3910409ee6", "networkId": "b00d52d5-40b8-4d71-83f1-1709cf47e812", "networkIdentifier": "DOMESTIC_FR" } ] } ], "meta": { "offset": 0, "limit": 1, "count": 1 } } ] } ```