title: How to put a Json respose in hashmap
body: <p>hi everyone i really need you help for this one
  i'm getting this json response using get request with retrofit :</p>
  <pre><code> [{
  &quot;id&quot;: 2,
  &quot;name&quot;: &quot;admin&quot;,
  &quot;password_last_update&quot;: null,
  &quot;phone&quot;: &quot;2516512&quot;,
  &quot;phone2&quot;: null,
  &quot;mobile&quot;: null,
  &quot;realname&quot;: &quot;zizo&quot;,
  &quot;firstname&quot;: null,
  &quot;locations_id&quot;: 0,
  &quot;language&quot;: null,
  &quot;use_mode&quot;: 0,
  &quot;list_limit&quot;: 20,
  &quot;is_active&quot;: 1,
  &quot;comment&quot;: null,
  &quot;auths_id&quot;: 0,
  &quot;authtype&quot;: 1,
  &quot;last_login&quot;: &quot;2021-06-14 17:36:58&quot;,
  &quot;date_mod&quot;: &quot;2021-06-14 16:29:50&quot;,
  &quot;date_sync&quot;: null,
  &quot;is_deleted&quot;: 0,
  &quot;profiles_id&quot;: 0,
  &quot;entities_id&quot;: 0,
  &quot;usertitles_id&quot;: 0,
  &quot;usercategories_id&quot;: 0,
  &quot;date_format&quot;: null,
  &quot;number_format&quot;: null,
  &quot;names_format&quot;: null,
  &quot;csv_delimiter&quot;: null,
  &quot;is_ids_visible&quot;: null,
  &quot;use_flat_dropdowntree&quot;: null,
  &quot;show_jobs_at_login&quot;: null,
  &quot;priority_1&quot;: null,
  &quot;priority_2&quot;: null,
  &quot;priority_3&quot;: null,
  &quot;priority_4&quot;: null,
  &quot;priority_5&quot;: null,
  &quot;priority_6&quot;: null,
  &quot;followup_private&quot;: null,
  &quot;task_private&quot;: null,
  &quot;default_requesttypes_id&quot;: null,
  &quot;password_forget_token&quot;: null,
  &quot;password_forget_token_date&quot;: null,
  &quot;user_dn&quot;: null,
  &quot;registration_number&quot;: null,
  &quot;show_count_on_tabs&quot;: null,
  &quot;refresh_views&quot;: null,
  &quot;set_default_tech&quot;: null,
  &quot;personal_token_date&quot;: null,
  &quot;api_token_date&quot;: null,
  &quot;cookie_token_date&quot;: &quot;2021-06-14 16:29:50&quot;,
  &quot;display_count_on_home&quot;: null,
  &quot;notification_to_myself&quot;: null,
  &quot;duedateok_color&quot;: null,
  &quot;duedatewarning_color&quot;: null,
  &quot;duedatecritical_color&quot;: null,
  &quot;duedatewarning_less&quot;: null,
  &quot;duedatecritical_less&quot;: null,
  &quot;duedatewarning_unit&quot;: null,
  &quot;duedatecritical_unit&quot;: null,
  &quot;display_options&quot;: null,
  &quot;is_deleted_ldap&quot;: 0,
  &quot;pdffont&quot;: null,
  &quot;picture&quot;: null,
  &quot;begin_date&quot;: null,
  &quot;end_date&quot;: null,
  &quot;keep_devices_when_purging_item&quot;: null,
  &quot;privatebookmarkorder&quot;: null,
  &quot;backcreated&quot;: null,
  &quot;task_state&quot;: null,
  &quot;layout&quot;: null,
  &quot;palette&quot;: null,
  &quot;set_default_requester&quot;: null,
  &quot;lock_autolock_mode&quot;: null,
  &quot;lock_directunlock_notification&quot;: null,
  &quot;date_creation&quot;: null,
  &quot;highcontrast_css&quot;: null,
  &quot;plannings&quot;: null,
  &quot;sync_field&quot;: null,
  &quot;groups_id&quot;: 0,
  &quot;users_id_supervisor&quot;: 0,
  &quot;timezone&quot;: null,
  &quot;default_dashboard_central&quot;: null,
  &quot;default_dashboard_assets&quot;: null,
  &quot;default_dashboard_helpdesk&quot;: null,
  &quot;default_dashboard_mini_ticket&quot;: null,
  &quot;links&quot;: [
    {
      &quot;rel&quot;: &quot;Entity&quot;,
      &quot;href&quot;: &quot;https://aziz.with7.glpi-network.cloud/apirest.php/Entity/0&quot;
    },
    {
      &quot;rel&quot;: &quot;Document_Item&quot;,
      &quot;href&quot;: &quot;https://aziz.with7.glpi-network.cloud/apirest.php/User/2/Document_Item/&quot;
    }
    ]
    },
     {
     &quot;id&quot;: 6,
     &quot;name&quot;: &quot;aziz&quot;,
  &quot;password_last_update&quot;: &quot;2021-05-31 12:01:43&quot;,
  &quot;phone&quot;: &quot;&quot;,
  &quot;phone2&quot;: &quot;&quot;,
  &quot;mobile&quot;: &quot;&quot;,
  &quot;realname&quot;: &quot;aziz&quot;,
  &quot;firstname&quot;: &quot;&quot;,
  &quot;locations_id&quot;: 0,
  &quot;language&quot;: null,
  &quot;use_mode&quot;: 0,
  &quot;list_limit&quot;: null,
  &quot;is_active&quot;: 1,
  &quot;comment&quot;: &quot;&quot;,
  &quot;auths_id&quot;: 0,
  &quot;authtype&quot;: 1,
  &quot;last_login&quot;: &quot;2021-06-14 16:48:52&quot;,
  &quot;date_mod&quot;: &quot;2021-06-14 16:48:52&quot;,
  &quot;date_sync&quot;: null,
  &quot;is_deleted&quot;: 0,
  &quot;profiles_id&quot;: 0,
  &quot;entities_id&quot;: 0,
  &quot;usertitles_id&quot;: 0,
  &quot;usercategories_id&quot;: 0,
  &quot;date_format&quot;: null,
  &quot;number_format&quot;: null,
  &quot;names_format&quot;: null,
  &quot;csv_delimiter&quot;: null,
  &quot;is_ids_visible&quot;: null,
  &quot;use_flat_dropdowntree&quot;: null,
  &quot;show_jobs_at_login&quot;: null,
  &quot;priority_1&quot;: null,
  &quot;priority_2&quot;: null,
  &quot;priority_3&quot;: null,
  &quot;priority_4&quot;: null,
  &quot;priority_5&quot;: null,
  &quot;priority_6&quot;: null,
  &quot;followup_private&quot;: null,
  &quot;task_private&quot;: null,
  &quot;default_requesttypes_id&quot;: null,
  &quot;password_forget_token&quot;: null,
  &quot;password_forget_token_date&quot;: null,
  &quot;user_dn&quot;: null,
  &quot;registration_number&quot;: &quot;&quot;,
  &quot;show_count_on_tabs&quot;: null,
  &quot;refresh_views&quot;: null,
  &quot;set_default_tech&quot;: null,
  &quot;personal_token_date&quot;: null,
  &quot;api_token_date&quot;: null,
  &quot;cookie_token_date&quot;: &quot;2021-06-14 16:48:52&quot;,
  &quot;display_count_on_home&quot;: null,
  &quot;notification_to_myself&quot;: null,
  &quot;duedateok_color&quot;: null,
  &quot;duedatewarning_color&quot;: null,
  &quot;duedatecritical_color&quot;: null,
  &quot;duedatewarning_less&quot;: null,
  &quot;duedatecritical_less&quot;: null,
  &quot;duedatewarning_unit&quot;: null,
  &quot;duedatecritical_unit&quot;: null,
  &quot;display_options&quot;: null,
  &quot;is_deleted_ldap&quot;: 0,
  &quot;pdffont&quot;: null,
  &quot;picture&quot;: &quot;f7/6_60c3e5d2a69f7.jpg&quot;,
  &quot;begin_date&quot;: null,
  &quot;end_date&quot;: null,
  &quot;keep_devices_when_purging_item&quot;: null,
  &quot;privatebookmarkorder&quot;: null,
  &quot;backcreated&quot;: null,
  &quot;task_state&quot;: null,
  &quot;layout&quot;: null,
  &quot;palette&quot;: null,
  &quot;set_default_requester&quot;: null,
  &quot;lock_autolock_mode&quot;: null,
  &quot;lock_directunlock_notification&quot;: null,
  &quot;date_creation&quot;: &quot;2021-05-31 12:01:43&quot;,
  &quot;highcontrast_css&quot;: null,
  &quot;plannings&quot;: null,
  &quot;sync_field&quot;: null,
  &quot;groups_id&quot;: 0,
  &quot;users_id_supervisor&quot;: 0,
  &quot;timezone&quot;: null,
  &quot;default_dashboard_central&quot;: null,
  &quot;default_dashboard_assets&quot;: null,
  &quot;default_dashboard_helpdesk&quot;: null,
  &quot;default_dashboard_mini_ticket&quot;: null,
  &quot;links&quot;: [
    {
      &quot;rel&quot;: &quot;Entity&quot;,
      &quot;href&quot;: &quot;https://aziz.with7.glpi-network.cloud/apirest.php/Entity/0&quot;
    },
    {
      &quot;rel&quot;: &quot;Document_Item&quot;,
      &quot;href&quot;: &quot;https://aziz.with7.glpi-network.cloud/apirest.php/User/6/Document_Item/&quot;
    }
  ]
  },
  {
  &quot;id&quot;: 7,
  &quot;name&quot;: &quot;kaso&quot;,
  &quot;password_last_update&quot;: &quot;2021-06-08 00:12:10&quot;,
  &quot;phone&quot;: &quot;&quot;,
  &quot;phone2&quot;: &quot;&quot;,
  &quot;mobile&quot;: &quot;&quot;,
  &quot;realname&quot;: &quot;ben Haj Laroussi&quot;,
  &quot;firstname&quot;: &quot;Mohamed Aziz&quot;,
  &quot;locations_id&quot;: 0,
  &quot;language&quot;: null,
  &quot;use_mode&quot;: 0,
  &quot;list_limit&quot;: null,
  &quot;is_active&quot;: 1,
  &quot;comment&quot;: &quot;&quot;,
  &quot;auths_id&quot;: 0,
  &quot;authtype&quot;: 1,
  &quot;last_login&quot;: &quot;2021-06-13 17:18:45&quot;,
  &quot;date_mod&quot;: &quot;2021-06-12 01:32:23&quot;,
  &quot;date_sync&quot;: null,
  &quot;is_deleted&quot;: 0,
  &quot;profiles_id&quot;: 0,
  &quot;entities_id&quot;: 0,
  &quot;usertitles_id&quot;: 0,
  &quot;usercategories_id&quot;: 0,
  &quot;date_format&quot;: null,
  &quot;number_format&quot;: null,
  &quot;names_format&quot;: null,
  &quot;csv_delimiter&quot;: null,
  &quot;is_ids_visible&quot;: null,
  &quot;use_flat_dropdowntree&quot;: null,
  &quot;show_jobs_at_login&quot;: null,
  &quot;priority_1&quot;: null,
  &quot;priority_2&quot;: null,
  &quot;priority_3&quot;: null,
  &quot;priority_4&quot;: null,
  &quot;priority_5&quot;: null,
  &quot;priority_6&quot;: null,
  &quot;followup_private&quot;: null,
  &quot;task_private&quot;: null,
  &quot;default_requesttypes_id&quot;: null,
  &quot;password_forget_token&quot;: null,
  &quot;password_forget_token_date&quot;: null,
  &quot;user_dn&quot;: null,
  &quot;registration_number&quot;: &quot;&quot;,
  &quot;show_count_on_tabs&quot;: null,
  &quot;refresh_views&quot;: null,
  &quot;set_default_tech&quot;: null,
  &quot;personal_token_date&quot;: null,
  &quot;api_token_date&quot;: null,
  &quot;cookie_token_date&quot;: &quot;2021-06-08 00:18:05&quot;,
  &quot;display_count_on_home&quot;: null,
  &quot;notification_to_myself&quot;: null,
  &quot;duedateok_color&quot;: null,
  &quot;duedatewarning_color&quot;: null,
  &quot;duedatecritical_color&quot;: null,
  &quot;duedatewarning_less&quot;: null,
  &quot;duedatecritical_less&quot;: null,
  &quot;duedatewarning_unit&quot;: null,
  &quot;duedatecritical_unit&quot;: null,
  &quot;display_options&quot;: null,
  &quot;is_deleted_ldap&quot;: 0,
  &quot;pdffont&quot;: null,
  &quot;picture&quot;: null,
  &quot;begin_date&quot;: null,
  &quot;end_date&quot;: null,
  &quot;keep_devices_when_purging_item&quot;: null,
  &quot;privatebookmarkorder&quot;: null,
  &quot;backcreated&quot;: null,
  &quot;task_state&quot;: null,
  &quot;layout&quot;: null,
  &quot;palette&quot;: null,
  &quot;set_default_requester&quot;: null,
  &quot;lock_autolock_mode&quot;: null,
  &quot;lock_directunlock_notification&quot;: null,
  &quot;date_creation&quot;: &quot;2021-06-08 00:12:10&quot;,
  &quot;highcontrast_css&quot;: null,
  &quot;plannings&quot;: null,
  &quot;sync_field&quot;: null,
  &quot;groups_id&quot;: 0,
  &quot;users_id_supervisor&quot;: 0,
  &quot;timezone&quot;: null,
  &quot;default_dashboard_central&quot;: null,
  &quot;default_dashboard_assets&quot;: null,
  &quot;default_dashboard_helpdesk&quot;: null,
  &quot;default_dashboard_mini_ticket&quot;: null,
  &quot;links&quot;: [
    {
      &quot;rel&quot;: &quot;Entity&quot;,
      &quot;href&quot;: &quot;https://aziz.with7.glpi-network.cloud/apirest.php/Entity/0&quot;
    },
    {
      &quot;rel&quot;: &quot;Document_Item&quot;,
      &quot;href&quot;: &quot;https://aziz.with7.glpi-network.cloud/apirest.php/User/7/Document_Item/&quot;
    }
  ]
  }
  ]
  </code></pre>
  <p>i'm using this code to get the data and to put it in a List :</p>
  <pre><code>    Retrofit retrofit= RetrofitInstance.getRetrofitInstance();
      final Api api= retrofit.create(Api.class);
      Call&lt;List&lt;User&gt;&gt; call = api.getUser(sestoken);
      call.enqueue(new Callback&lt;List&lt;User&gt;&gt;() {
          @Override
          public void onResponse(Call&lt;List&lt;User&gt;&gt; call, Response&lt;List&lt;User&gt;&gt; response) {
  
              if (response.code() != 200){
                  Log.e(&quot;TAG&quot;, &quot;onResponse: something is wrong&quot;+response.code() );
  
  
  
              }
              List&lt;User&gt; users = response.body();
  
  
  
              for (User user : users){
  
                  userList.add(user);
              }
  
              
  
  
  
             
  
          }
  
          @Override
          public void onFailure(Call&lt;List&lt;User&gt;&gt; call, Throwable t) {
  
  
          }
      });
  </code></pre>
  <p>and this is the user class
  package model;</p>
  <pre><code>public class User {
  
  private String name;
  private String id;
  
  
  public String getName() { return name; }
  
  public String getId() {
      return id;
  }
  </code></pre>
  <p>}</p>
  <p>i only need to put the id and name in a hashmap i really didn't know how to do it i could only put the data in a list . appreciate the help</p>