Erro ao enviar Cadastro de empresas

bom dia / envio de cadastro de empresas

curl -X “POST” “https://api.nuvemfiscal.com.br/empresas” -H “accept: application/json” -H “Content-Type: applicaton/json” -H “Authorization: Bearer ey1111g” -d {“cpf_cnpj”:“111111”,“created_at”:“2024-12-02T06:01:11:332Z”,“updated_at”:“2024-12-02T06:01:11:332Z”,“inscricao_estadual”:“ISENTO”,“nome_razao_social”:“1111AECOMUNICACAOLTDA”,“nome_fantasia”:“11111UNICACAOLTDA”,“email”:“s111@111.com.br”,“endereco”:{“logradouro”:“RSAOCRISTOVAO”,“numero”:“111”,“complemento”:“”,“bairro”:“ITINGA”,“codigo_municipio”:“2919207”,“cidade”:“LaurodeFreitas”,“uf”:“BA”,“codigo_pais”:“55”,“pais”:“BRASIL”,“cep”:“42700000”}} -verbose Content-Length: 23

Content-Length: 23

  • upload completely sent off: 23 out of 23 bytes
    < HTTP/1.1 301 Moved Permanently
    < Date: Mon, 02 Dec 2024 11:42:50 GMT
    < Server: Apache
    < Expires: Wed, 17 Aug 2005 00:00:00 GMT
    < Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    < Pragma: no-cache
    < Set-Cookie: dbd9fe84af46ec74665933ecc88bd468=7c1c2a7819d6366473a799e74b63ecd9; path=/; secure; HttpOnly
    < Location: https://sitelco.com.br/
    < Last-Modified: Mon, 02 Dec 2024 11:42:51 GMT
    < Transfer-Encoding: chunked
    < Content-Type: text/html; charset=utf-8
    <
  • Connection #1 to host sitelco.com.br left intact
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:logradouro:RSAOCRISTOVAO/
  • Port number ended with ‘l’
  • Closing connection -1
    curl: (3) Port number ended with ‘l’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:numero:114/
  • Port number ended with ‘n’
  • Closing connection -1
    curl: (3) Port number ended with ‘n’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:complemento:/
  • Port number ended with ‘c’
  • Closing connection -1
    curl: (3) Port number ended with ‘c’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:bairro:ITINGA/
  • Port number ended with ‘b’
  • Closing connection -1
    curl: (3) Port number ended with ‘b’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:codigo_municipio:2919207/
  • Port number ended with ‘c’
  • Closing connection -1
    curl: (3) Port number ended with ‘c’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:cidade:LaurodeFreitas/
  • Port number ended with ‘c’
  • Closing connection -1
    curl: (3) Port number ended with ‘c’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:uf:BA/
  • Port number ended with ‘u’
  • Closing connection -1
    curl: (3) Port number ended with ‘u’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:codigo_pais:55/
  • Port number ended with ‘c’
  • Closing connection -1
    curl: (3) Port number ended with ‘c’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:pais:BRASIL/
  • Port number ended with ‘p’
  • Closing connection -1
    curl: (3) Port number ended with ‘p’
    Note: Unnecessary use of -X or --request, POST is already inferred.
  • Rebuilt URL to: endereco:cep:42700000/
  • Port number ended with ‘c’
  • Closing connection -1
    curl: (3) Port number ended with ‘c’

o que esta errado ?

Bom dia, @inforaut.

Há vários erros no seu comando cURL.

Segue uma versão corrigida:

curl -X POST "https://api.nuvemfiscal.com.br/empresas" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ey1111g" \
-d '{
  "cpf_cnpj": "111111",
  "inscricao_estadual": "ISENTO",
  "nome_razao_social": "1111 A E COMUNICACAO LTDA",
  "nome_fantasia": "11111 UNICACAO LTDA",
  "email": "s111@111.com.br",
  "endereco": {
    "logradouro": "R SAO CRISTOVAO",
    "numero": "111",
    "complemento": "",
    "bairro": "ITINGA",
    "codigo_municipio": "2919207",
    "cidade": "Lauro de Freitas",
    "uf": "BA",
    "codigo_pais": "55",
    "pais": "BRASIL",
    "cep": "42700000"
  }
}' \
--verbose

preenchi o seu exemplo mesmo mesmo e deu isso
{
“error”: {
“code”: “ValidationFailed”,
“message”: “Validation failed: O campo ‘endereco.codigo_pais’ não corresponde ao formato esperado ^\d{4}$”,
“errors”: [
{
“code”: “InvalidFormat”,
“message”: “O campo ‘endereco.codigo_pais’ não corresponde ao formato esperado ^\d{4}$”
}
]
}

  • Connection #0 to host api.nuvemfiscal.com.br left intact

qual o codigo do pais/formato correto / atual: “codigo_pais”: “55”

codigo de pais 1055 / passou !

valeu

Este tópico foi fechado automaticamente 24 horas depois da última resposta. Novas respostas não são mais permitidas.