Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 27-09-2023
Avatar de duilioisola
[duilioisola] duilioisola is offline
Miembro Premium
 
Registrado: ago 2007
Ubicación: Barcelona, España
Posts: 1.806
Poder: 22
duilioisola Es un diamante en brutoduilioisola Es un diamante en brutoduilioisola Es un diamante en bruto
Por lo que leí en la web que envías están publicados los endpoints en formato YAML para poder ser leido en la web https://editor.swagger.io/
El fichero YAML indica las "paths" que serían los endpoints y los parámetros que puedes utilizar.
Descarge el fichero y luego en la web que mencionan ves al menú "File" -> "Import File" y seleccionas el fichero.

Parece que hay tres endpoints
/check-vat-number
Ejemplo con CURL
Código:
curl -X 'POST' \
  'https://editor.swagger.io/check-vat-number' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "countryCode": "ES",
  "vatNumber": "X3245299E",
  "requesterMemberStateCode": "ES",
  "requesterNumber": "1",
  "traderName": "TEST",
  "traderStreet": "STR",
  "traderPostalCode": "08035",
  "traderCity": "Barcelona",
  "traderCompanyType": "eCommerce"
}'
/check-vat-test-service
/check-status

Contenido del fichero YAML
Código:
swagger: "2.0"
info:
  description: "This is the contract for Vies on-the-Web endpoints. 
  The checkVat service supports exact and approximate matching at the same time. 
  In order to retrieve the requestIdentifier, the information about requesterMemberStateCode and requesterNumber have to be provided."
  version: "1.0.0"
  title: "Vies on-the-Web Endpoint"
produces:
  - "application/json"
schemes:
  - "https"
paths:
  /check-vat-number:
    post:
      tags:
        - "public"
      summary: "Check a Vat Number for a specific country"
      operationId: "checkVatNumber"
      parameters:
        - name: "body"
          in: "body"
          description: "The request body"
          required: true
          schema:
            $ref: "#/definitions/CheckVatRequest"
      responses:
        "200":
          description: "Successful operation"
          schema:
            $ref: "#/definitions/CheckVatResponse"
        "400":
          description: "Bad Request"
          schema:
            $ref: "#/definitions/CommonResponse"
        "500":
          description: "Internal server error"
          schema:
            $ref: "#/definitions/CommonResponse"
  /check-vat-test-service:
    post:
      tags:
        - "public"
      summary: "Test the check vat service"
      operationId: "checkVatTestService"
      parameters:
        - name: "body"
          in: "body"
          description: "The request body"
          required: true
          schema:
            $ref: "#/definitions/CheckVatRequest"
      responses:
        "200":
          description: "Successful operation"
          schema:
            $ref: "#/definitions/CheckVatResponse"
        "400":
          description: "Bad Request"
          schema:
            $ref: "#/definitions/CommonResponse"
        "500":
          description: "Internal server error"
          schema:
            $ref: "#/definitions/CommonResponse"
  /check-status:
    get:
      tags:
        - "public"
      summary: "Check the status of each member states"
      operationId: "checkStatus"
      responses:
        "200":
          description: "Successful operation"
          schema:
            $ref: "#/definitions/StatusInformationResponse"
        "400":
          description: "Bad Request"
          schema:
            $ref: "#/definitions/CommonResponse"
        "500":
          description: "Internal server error"
          schema:
            $ref: "#/definitions/CommonResponse"
definitions:
  Match:
    type: "string"
    enum:
      - "VALID"
      - "INVALID"
      - "NOT_PROCESSED"
  CheckVatRequest:
    type: "object"
    properties:
      countryCode:
        type: "string"
      vatNumber:
        type: "string"
      requesterMemberStateCode:
        type: "string"
      requesterNumber:
        type: "string"
      traderName:
        type: "string"
      traderStreet:
        type: "string"
      traderPostalCode:
        type: "string"
      traderCity:
        type: "string"
      traderCompanyType:
        type: "string"
  CheckVatResponse:
    type: "object"
    properties:
      countryCode:
        type: "string"
      vatNumber:
        type: "string"
      requestDate:
        type: "string"
        format: "date-time"
      valid:
        type: "boolean"
      requestIdentifier:
        type: "string"
      name:
        type: "string"
      address:
        type: "string"
      traderName:
        type: "string"
      traderStreet:
        type: "string"
      traderPostalCode:
        type: "string"
      traderCity:
        type: "string"
      traderCompanyType:
        type: "string"
      traderNameMatch:
        $ref: "#/definitions/Match"
      traderStreetMatch:
        $ref: "#/definitions/Match"
      traderPostalCodeMatch:
        $ref: "#/definitions/Match"
      traderCityMatch:
        $ref: "#/definitions/Match"
      traderCompanyTypeMatch:
        $ref: "#/definitions/Match"
  CountryStatus:
    type: "object"
    properties:
      countryCode:
        type: "string"
      availability:
        type: "string"
        enum:
          - "Available"
          - "Unavailable"
          - "Monitoring Disabled"
  StatusInformationResponse:
    type: "object"
    properties:
      vow:
        type: "object"
        properties:
          available:
            type: "boolean"
      countries:
        type: "array"
        items:
          $ref: "#/definitions/CountryStatus"
  CommonResponse:
    type: "object"
    properties:
      actionSucceed:
        type: "boolean"
        description: "Indicate if the action succeed or not"
      errorWrappers:
        $ref: "#/definitions/ErrorWrappers"
  ErrorWrappers:
    type: "array"
    description: "Indicate the cause of the error when actionSucceed is false."
    items:
      $ref: "#/definitions/ErrorWrapper"
  ErrorWrapper:
    type: "object"
    description: "Define information about an error"
    properties:
      error:
        type: "string"
        description: "The error code"
      message:
        type: "string"
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Suma de números pares que hay entre dos números Daniel2622 Lazarus, FreePascal, Kylix, etc. 21 26-04-2017 22:47:29
Tablas de multiplicar para todos los números entre dos números Daniel2622 Lazarus, FreePascal, Kylix, etc. 3 22-04-2017 00:47:59
Documentos UDF's johan Firebird e Interbase 1 23-03-2010 17:19:01
Documentos XML cone220 Internet 1 03-11-2004 17:49:35
Documentos pdf roman PHP 5 27-09-2004 16:14:23


La franja horaria es GMT +2. Ahora son las 04:01:08.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi