Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!