soenac / api-dian Goto Github PK
View Code? Open in Web Editor NEWAPI Facturación Electrónica Validación Previa UBL 2.1
Home Page: https://soenac.com/api-dian
API Facturación Electrónica Validación Previa UBL 2.1
Home Page: https://soenac.com/api-dian
No entiendo mucho Laravelm favor me regalas un link del video de instalacion?
Gracias
Henry Pandales
Favor escribeme al whatsapp
wa.me/573147754208
Cuando se inicia el proyecto aparece el error en la pagina /api/ubl2.1/documentation
Aparece el error
Fetch errorNot Found http://xxxx:443/docs/api-docs.json
entonces se supone que el error es por que no genero el docs, y al ejecutar el comando
php artisan l5-swagger:generate
se genera el siguiente error
`php
ErrorException : Required @OA\Info() not found
at /var/www/html/dian2/vendor/zircote/swagger-php/src/Logger.php:39
35| $this->log = function ($entry, $type) {
36| if ($entry instanceof Exception) {
37| $entry = $entry->getMessage();
38| }
39| trigger_error($entry, $type);
40| };
41| }
42|
43| /**
Exception trace:
1 trigger_error("Required @OA\Info() not found")
/var/www/html/dian2/vendor/zircote/swagger-php/src/Logger.php:39
2 OpenApi\Logger::OpenApi{closure}("Required @OA\Info() not found")
/var/www/html/dian2/vendor/zircote/swagger-php/src/Logger.php:71
3 call_user_func(Object(Closure), "Required @OA\Info() not found")
/var/www/html/dian2/vendor/zircote/swagger-php/src/Logger.php:71
4 OpenApi\Logger::notice("Required @OA\Info() not found")
/var/www/html/dian2/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php:424
5 OpenApi\Annotations\AbstractAnnotation::validate([], [], "#")
/var/www/html/dian2/vendor/zircote/swagger-php/src/Annotations/OpenApi.php:135
6 OpenApi\Annotations\OpenApi::validate()
/var/www/html/dian2/vendor/zircote/swagger-php/src/Analysis.php:422
7 OpenApi\Analysis::validate()
/var/www/html/dian2/vendor/zircote/swagger-php/src/functions.php:46
8 OpenApi\scan("/var/www/html/dian2/app/Http/Controllers/Api", [])
/var/www/html/dian2/vendor/darkaonline/l5-swagger/src/Generator.php:119
9 L5Swagger\Generator::scanFilesForDocumentation()
/var/www/html/dian2/vendor/darkaonline/l5-swagger/src/Generator.php:66
10 L5Swagger\Generator::generateDocs()
/var/www/html/dian2/vendor/darkaonline/l5-swagger/src/Console/GenerateDocsCommand.php:32
11 L5Swagger\Console\GenerateDocsCommand::handle()
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
12 call_user_func_array([])
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
13 Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:90
14 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:34
15 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Container/Container.php:576
16 Illuminate\Container\Container::call()
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Console/Command.php:183
17 Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
/var/www/html/dian2/vendor/symfony/console/Command/Command.php:255
18 Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Console/Command.php:170
19 Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
/var/www/html/dian2/vendor/symfony/console/Application.php:921
20 Symfony\Component\Console\Application::doRunCommand(Object(L5Swagger\Console\GenerateDocsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
/var/www/html/dian2/vendor/symfony/console/Application.php:273
21 Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
/var/www/html/dian2/vendor/symfony/console/Application.php:149
22 Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Console/Application.php:90
23 Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
/var/www/html/dian2/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:133
24 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
/var/www/html/dian2/artisan:37
`
Indagando al parecer es por que en algun lugar de la documentación no especificaste la etiqueta info
se almacena correctamente en la bd
intente añadir el token de autorizacion como bearer token y desaparece el error pero no guarda la resolucion (si utilizo en token almacenado en la bd tampoco me funciona)
agradezco de antemano colaboración
Saludos, tengo algunas dudas, sobre la creación de otros tipos de documentos.
Favor regálame tu whatsapp
escríbeme al 3147754208
Saludos.
**Ya hice la prueba desde el PostMan y hace la prueba perfectamente.
Tengo un ERP en Visual FoxPro:
Menssage: "Unauthenicated"
Un compañero envió este código en VB6:
If RSRS.RecordCount > 0 Then
ReenviarFacturaAPI:Set xmlhttp = New MSXML2.ServerXMLHTTP60
If TipoInvoice = "GENERAL" Then
If RSCajaFE.Fields("TestSetIDFE") = "" Or IsNull(RSCajaFE.Fields("TestSetIDFE")) Then
xmlhttp.Open "POST", RSRS.Fields("UrlAPI21") & "/api/ubl2.1/invoice", False
Else
xmlhttp.Open "POST", RSRS.Fields("UrlAPI21") & *"/api/ubl2.1/invoice/" & RSCajaFE.Fields("TestSetIDFE"), False
End If
Else
If TipoInvoice = "AIU" Then
If RSCajaFE.Fields("TestSetIDFE") = "" Or IsNull(RSCajaFE.Fields("TestSetIDFE")) Then
xmlhttp.Open "POST", RSRS.Fields("UrlAPI21") & "/api/ubl2.1/invoice-aiu", False
Else
xmlhttp.Open "POST", RSRS.Fields("UrlAPI21") & "/api/ubl2.1/invoice-aiu/" & RSCajaFE.Fields("TestSetIDFE"), False
End If
Else
If TipoInvoice = "EXPORTACION" Then
If RSCajaFE.Fields("TestSetIDFE") = "" Or IsNull(RSCajaFE.Fields("TestSetIDFE")) Then
xmlhttp.Open "POST", RSRS.Fields("UrlAPI21") & "/api/ubl2.1/invoice-export", False
Else
xmlhttp.Open "POST", RSRS.Fields("UrlAPI21") & "/api/ubl2.1/invoice-export/" & RSCajaFE.Fields("TestSetIDFE"), False
End If
End If
End If
End If
xmlhttp.setRequestHeader "accept", "application/json"
xmlhttp.setRequestHeader "Authorization", "Bearer " & Trim(RSRS.Fields("PasswordAPI"))
xmlhttp.setRequestHeader "Content-Type", "application/json"
xmlhttp.setRequestHeader "X-CSRF-TOKEN", " "
xmlhttp.send *PlantillaJSON
Yo uso este Código en VFP9:
ruta = "http://localhost/apidian2020/public/api/ubl2.1/invoice/e423daa7-201c-4bf9-a751-acebd3e3984a"
token = "08f86bff3506b88fb95812d8942b4f138c84470bb72026abdfc4443b1038adea"
post_connect = CREATEOBJECT('MSXML2.ServerXMLHTTP')
post_connect.Open("POST", ruta, .F.)
*******
post_connect.setRequestHeader("accept", "application/json")
post_connect.setRequestHeader("Content-Type", "application/json")
post_connect.setRequestHeader("Authorization", "Bearer Token="+token)
*******
post_connect.Send(json_para_envio)
json_respuesta = post_connect.responsetext
Pero en JSON_RESPUESTA me devuelve
Menssage: "Unauthenicated"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.