The Spanish version is the authoritative reference. View in Spanish
API Inbox
An API is a communication channel that allows us to establish an interaction between one company's products and services and another's.
APIs are considered contracts, with documentation representing an agreement between the parties: if one party sends a remote request with a particular structure, that same structure will determine how the other party's software responds.
APIs allow products and services to communicate with each other without needing to know how they are implemented. This simplifies application development and helps save time and money. APIs give you flexibility; they simplify the design, administration, and use of applications; and they offer opportunities for innovation, which is ideal when designing new tools and products (or managing existing ones).
Undoubtedly, this is an essential feature for providing a good user experience to customers, since it helps reduce response times.
API Features
- They make developers' work easier.
- They reduce workload.
- They control access to resources.
- They are easy to use.
- They are used for communication between services.
On the other hand, they are also very useful when we want to use the functions of a service with the intention that clients use our application.
What is a REST API?
To understand what a REST API is, it is necessary to first define the original type of API, that is, SOAP APIs.
This is a protocol specification that standardizes the exchange of information. It gets its name from its acronym in English, which stands for Simple Object Access Protocol (SOAP). This type of API uses XML for the format of its messages and receives requests over HTTP or SMTP.
With SOAP, it is easier for applications that run in different environments or are written in different languages to share information.
We can find REST APIs on the web, and their main difference is that SOAP is a protocol while REST is an architectural style, so it does not have an official standard.
A REST API, or RESTful API, is an application programming interface (API or web API) that conforms to the constraints of REST architecture and allows interaction with RESTful web services.
Throughout this content you will find national flags that indicate the features shown are exclusive to a particular country.
Definition, benefits, and features of the Gosocket REST API
Definition
The Gosocket API is a set of functions and procedures that allow secure interaction between external applications and Gosocket products, enabling the exchange of DTEs according to the Local Schema.
This API has several methods that allow options such as making requests to the tax authority, adding attachments to documents, and obtaining document information, among others, both synchronously and asynchronously.
This development is based on a REST API, which allows us to deliver an online service that offers a DTE Management network and the validation of the corresponding electronic tax entity.
In the communication process, the client initiates a request. To do this, the server and the web client communicate using an information exchange format, which can be Json or another language such as XML.

Benefits
- Simple, risk-free access: APIs allow you to offer access to resources while maintaining the security and control of the information being managed.
- Access control over information: You decide how you enable access and to whom you grant it.
- Client/server separation: Being independent systems, they can be managed as autonomous projects and autonomous teams.
- Reliability, scalability, flexibility: Using components with Microsoft Azure helps applications perform optimally when demand changes, in addition to the availability and security guaranteed by Microsoft.
- User experience: An API-based website can perform better than a traditional one. When a request is made to the server, the response obtained is plain data that requires shorter transfer times than if that same data were received mixed with the presentation's HTML/CSS. Through this whole process, we can achieve web applications that resemble desktop applications more closely, making requests and returns more user-friendly.
Functional scope
Depending on the operating model, it has the following functional scope based on the schemas defined by the local tax authority:
- Integration model through consumption methods.
- Generation and signing of the tax XML.
- Uploading the digital certificate for signing the tax document.
- Dispatching/sending the XML to the tax entity and obtaining acceptance or rejection of the document by the tax authority.
API Authentication
The Gosocket API is implemented with the HTTPS protocol, using TLS 1.2. Authentication is the process of identifying whether the credentials sent in the request are valid or not. There are different authentication methods, and the Gosocket API supports the following:
- Basic Auth
- oAuth 2.0
To use the methods available in the Gosocket API, access credentials are required according to the defined authentication method. These credentials can only be generated by a user with an administrator profile and an @gosocket.net domain.
These credentials must be requested directly from the assigned Project Manager and/or consultant.
Basic Auth
Basic Authentication, or Basic Auth, is one of the simplest authentication methods. It consists of sending the request with a user ID and a password.
UserName: xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx
Password: xxxxxxxxxxxxxx
The user ID and password are generated and provided by Gosocket, both for the testing environment and for the production environment.
Request your Basic Auth-type access credentials from the assigned Project Manager and/or consultant.
Consuming the API with Basic Auth
To consume the API with basic authentication, you need to use the previously assigned credentials.

https://developers-sbx.gosocket.net/api/v1/https://developers.gosocket.net/api/v1/oAuth 2.0
OAuth 2.0 is an authorization framework based on token-based authentication that allows access to the API without revealing user credentials, thanks to its use of access tokens. This method is used to guarantee the security of the user's confidential information, since the user's credentials remain private and are not shared with the API.
When a user requests access to an API, the API will ask the user to provide their credentials. These credentials are then authenticated by the authentication server, which generates an access token used to access the API. This token is only valid for a specific period of time, after which the user must authenticate again to continue using the API.
Using access tokens instead of user credentials also makes it easier for users to manage their security settings. Users can revoke access to their API without having to change their password, and they can also manage the level of access granted to third-party applications. Overall, OAuth 2.0 provides a secure and flexible method for accessing APIs while protecting user privacy and security.
Obtaining a Token
To obtain the access token, you must call the endpoint:
https://developers-sbx.gosocket.net/oauth2/tokenhttps://developers.gosocket.net/oauth2/tokenThe POST method is used, along with the following parameters:
| Parameter | Value |
|---|---|
| grant_type: | client\_credentials |
| client_id: | UserName from the credentials generated by Gosocket |
| client_secret: | Password from the credentials generated by Gosocket |
| scope: | all |
The token obtained is of type "Bearer"
Example:

Consuming the API with oAuth 2.0
To consume the API, you need to use the token obtained and configure the Bearer Token authentication method. Keep in mind the token's validity period, since if it expires, you must generate a new one.

https://developers-sbx.gosocket.net/api/v2/https://developers.gosocket.net/api/v2/Structures by country
Below, we list the Country Document ID structures by country:

To make your request processes easier, we provide the tax ID structures by country:
