title: org.json.JSONException: No value for senses
body: <p>I am trying to make an English Dictionary using the Oxford API. I made this according to docs and resources found on the web. But I got this issue <code>&quot;org.json.JSONException: No value for senses&quot; </code>and I don't why. Wherever I looked I couldn't find reason of this issue. I'll give you my <code>MainActivity</code> and <code>request class</code>. Can anyone help me?</p>
  <p>MainActiviy:</p>
  <pre><code>package com.alitalhacoban.english_dictionary;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.TextView;
  import androidx.appcompat.app.AppCompatActivity;
  public class MainActivity extends AppCompatActivity {
  
      TextView textView;
      EditText editText;
  
      private String url;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          textView = findViewById(R.id.textView);
          editText = findViewById(R.id.editText);
  
          url = dictionaryEntries();
  
  
      }
  
      public void find(View view){
  
          MyDictionaryRequest myDictionaryRequest = new MyDictionaryRequest(this);
          myDictionaryRequest.execute(url);
  
      }
  
      private String dictionaryEntries() {
          final String language = &quot;en-gb&quot;;
          final String word = &quot;Ace&quot;;
          final String fields = &quot;pronunciations&quot;;
          final String strictMatch = &quot;false&quot;;
          final String word_id = word.toLowerCase();
          return &quot;https://od-api.oxforddictionaries.com:443/api/v2/entries/&quot; + language + &quot;/&quot; + word_id + &quot;?&quot; + &quot;fields=&quot; + fields + &quot;&amp;strictMatch=&quot; + strictMatch;
      }
  }
  </code></pre>
  <p>Request class:</p>
  <pre><code>
  import android.content.Context;
  import android.os.AsyncTask;
  import android.util.Log;
  import android.widget.Toast;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.net.URL;
  
  import javax.net.ssl.HttpsURLConnection;
  
  public class MyDictionaryRequest extends AsyncTask&lt;String, Integer, String&gt; {
  
      Context context;
  
      MyDictionaryRequest(Context context) {
          this.context = context;
      }
  
      final String app_id = &quot;127ae33f&quot;;
      final String app_key = &quot;e42c0fccfe30223fb9ec02e12ae8c8a9&quot;;
  
      @Override
      protected String doInBackground(String... params) {
          try {
              URL url = new URL(params[0]);
              HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
              urlConnection.setRequestProperty(&quot;Accept&quot;, &quot;application/json&quot;);
              urlConnection.setRequestProperty(&quot;app_id&quot;, app_id);
              urlConnection.setRequestProperty(&quot;app_key&quot;, app_key);
  
  
              BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
              StringBuilder stringBuilder = new StringBuilder();
  
              String line;
              while ((line = reader.readLine()) != null) {
                  stringBuilder.append(line).append(&quot;\n&quot;);
              }
  
              return stringBuilder.toString();
  
          } catch (Exception e) {
              e.printStackTrace();
              return e.toString();
          }
      }
  
      @Override
      protected void onPostExecute(String result) {
          super.onPostExecute(result);
  
          String def = &quot;&quot;;
          try {
              JSONObject js = new JSONObject(result);
              JSONArray results = js.getJSONArray(&quot;results&quot;);
              for (int i = 0; i &lt; results.length(); i++) {
                  JSONObject lentries = results.getJSONObject(i);
                  JSONArray la = lentries.getJSONArray(&quot;lexicalEntries&quot;);
                  for (int j = 0; j &lt; la.length(); j++) {
                      JSONObject entries = la.getJSONObject(j);
                      JSONArray e = entries.getJSONArray(&quot;entries&quot;);
                      for (int k = 0; k &lt; e.length(); k++) {
                          JSONObject senses = e.getJSONObject(k);
                          JSONArray s = senses.getJSONArray(&quot;senses&quot;);
                          JSONObject d = e.getJSONObject(0);
                          JSONArray de = d.getJSONArray(&quot;definitions&quot;);
                          def = de.getString(0);
                      }
                  }
              }
              Log.e(&quot;def&quot;, def);
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
      }
  }
  </code></pre>