Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
basic question on parsin json results with javascript

after researching A LOT I found myself in the to create a question here.

Usually I make an API call to a server and it returns like this

{
"codigo": 200,
"pessoas": [
    {
        "idpessoa": "5",
        "idpessoa_legado": null,
        "ativo": "S",
        "ativo_painel": "S",
        "ativo_login": "S",
        "idpais": "3",
        "idestado": "25",
        "idcidade": "5370",
        "documento": "12345678999"
     }
]}

And whenever I need to call it up, I use a function like this:

user.set('documento', resp.pessoas[0].documento);

the "resp" part is a function that connects with the API. user.set sets the result to the new variable. It works fine as it should.

But I stumbled uppon an API that looks like this:

{
"510": {
    "situacao": {
        "idsituacao": "3",
        "situacao": "Vendida"
    },
    "imobiliaria": {
        "email": null,
        "telefone": null,
        "cnpj": null
    },
    "unidade": {
        "empreendimento": "Artesano Galleria",
        "idempreendimento_int": "19",
        "etapa": "ETAPA 01",
...

I've never seen a json response without [] signs. This one has only {} signs. I have no idea on how to call it and get the value from 510.unidade.idempreendimento_int Another problem is that it already starts with its own ID.

Help please! :)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda