0

Есть такой json ответ от апи. Как получить его значения? Пробовал вот так

 dynamic userId =  JsonConvert.DeserializeObject(data);

Получается непонятно что. Вот json:

  {
  "data": {
    "id": "cde0bc5f-8602-4e12-b5d3-f03436b54c0d",
    "first_name": "Erlich",
    "last_name": "Bachman",
    "salutation": "Mr",
    "emails": [
      {
        "type": "primary",
        "email": "info@piedpiper.eu"
      }
    ],
    "telephones": [
      {
        "type": "phone",
        "number": "092980615"
      }
    ],
    "website": "https://piedpiper.com",
    "addresses": [
      {
        "type": "invoicing",
        "address": {
          "addressee": "Teamleader HQ",
          "line_1": "Dok Noord 3A 101",
          "postal_code": "9000",
          "city": "Ghent",
          "country": "BE"
        }
      }
    ],
    "gender": "male",
    "birthdate": "1987-04-25",
    "iban": "BE12123412341234",
    "bic": "BICBANK",
    "national_identification_number": "00051730-A",
    "companies": [
      {
        "position": "CEO",
        "decision_maker": true,
        "company": {
          "type": "company",
          "id": "40157f9d-1322-4f2e-b245-188efdc52cc2"
        }
      }
    ],
    "language": "en",
    "payment_term": {
      "type": "cash"
    },
    "invoicing_preferences": {
      "electronic_invoicing_address": null
    },
    "remarks": "First contact at expo",
    "tags": [
      "prospect",
      "expo"
    ],
    "custom_fields": [
      {
        "definition": {
          "type": "customFieldDefinition",
          "id": "bf6765de-56eb-40ec-ad14-9096c5dc5fe1"
        },
        "value": "092980616"
      }
    ],
    "marketing_mails_consent": false,
    "added_at": "2016-02-04T16:44:33+00:00",
    "updated_at": "2016-02-05T16:44:33+00:00",
    "web_url": "https://app.teamleader.eu/contact_detail.php?id=cde0bc5f-8602-4e12-b5d3-f03436b54c0d"
  }
}
LoopEx
  • 41
  • Так нужно? http://ru.stackoverflow.com/questions/498833/%d0%94%d0%b5%d1%81%d0%b5%d1%80%d0%b8%d0%b0%d0%bb%d0%b8%d0%b7%d0%b0%d1%86%d0%b8%d1%8f-json-%d0%b2-%d0%ba%d0%be%d0%bb%d0%bb%d0%b5%d0%ba%d1%86%d0%b8%d1%8e/498850 – nick_n_a Aug 22 '19 at 09:17
  • Почитайте похожие вопросы http://ru.stackoverflow.com/search?q=JsonConvert.DeserializeObject+%5Bc%23%5D – nick_n_a Aug 22 '19 at 09:18
  • Или в список надо так https://ru.stackoverflow.com/questions/653518/%d0%94%d0%b5%d1%81%d0%b5%d1%80%d0%b8%d0%b0%d0%bb%d0%b8%d0%b7%d0%b0%d1%86%d0%b8%d1%8f-%d0%ba%d0%be%d0%bb%d0%bb%d0%b5%d0%ba%d1%86%d0%b8%d0%b8-%d0%be%d0%b1%d1%8a%d0%b5%d0%ba%d1%82%d0%be%d0%b2-json? – nick_n_a Aug 22 '19 at 09:19

0 Answers0