title: Getting error (java.lang.NoSuchMethodError: okhttp3.Request$Builder.tag) while posting event to microsoft graph
body: <p>I am trying to hit the microsoft graph api for get and post methods.
  Java code:</p>
  <pre><code>IGraphServiceClient graphClient = 
               GraphServiceClient.builder().authenticationProvider(authProvider)
              .buildClient();
   graphClient.me().calendar().events().buildRequest().post(event);
   User user = graphClient.me().buildRequest().get();
   
  </code></pre>
  <p>On hitting the api I get this error:</p>
  <blockquote>
  <p>Exception in thread &quot;main&quot; java.lang.NoSuchMethodError: okhttp3.Request$Builder.tag(Ljava/lang/Class;Ljava/lang/Object;)Lokhttp3/Request$Builder;
  at com.microsoft.graph.http.CoreHttpProvider.getHttpRequest(CoreHttpProvider.java:257)
  at com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:397)
  at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:220)
  at com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:200)
  at com.microsoft.graph.http.BaseRequest.send(BaseRequest.java:345)
  at com.microsoft.graph.requests.extensions.EventRequest.post(EventRequest.java:135)
  at com.microsoft.graph.requests.extensions.EventCollectionRequest.post(EventCollectionRequest.java:75)</p>
  </blockquote>
  <p>Maven versions for graph and graph-auth api's are:</p>
  <pre><code>    &lt;!-- https://mvnrepository.com/artifact/com.microsoft.graph/microsoft-graph --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.microsoft.graph&lt;/groupId&gt;
          &lt;artifactId&gt;microsoft-graph&lt;/artifactId&gt;
          &lt;version&gt;2.5.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/com.microsoft.graph/microsoft-graph-auth --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.microsoft.graph&lt;/groupId&gt;
          &lt;artifactId&gt;microsoft-graph-auth&lt;/artifactId&gt;
          &lt;version&gt;0.3.0-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  <p>Please help me resolve this issue?</p>
  <p>This is the main method:</p>
  <pre><code>public static void main(String[] args) {
  
      UsernamePasswordProvider authProvider = new UsernamePasswordProvider(&quot;{client_id}&quot;,
              Arrays.asList(&quot;https://graph.microsoft.com/.default&quot;),
              &quot;{username}&quot;, &quot;{password}&quot;, NationalCloud.Global,
              &quot;{tenant_id}&quot;, &quot;{client_secret}&quot;);
  
      IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider(authProvider)
              .buildClient();
  
      Event event = new Event();
      event.subject = &quot;Let's go for lunch&quot;;
      ItemBody body = new ItemBody();
      body.contentType = BodyType.HTML;
      body.content = &quot;Does mid month work for you?&quot;;
      event.body = body;
      DateTimeTimeZone start = new DateTimeTimeZone();
      start.dateTime = &quot;2021-01-15T12:00:00&quot;;
      start.timeZone = &quot;Pacific Standard Time&quot;;
      event.start = start;
      DateTimeTimeZone end = new DateTimeTimeZone();
      end.dateTime = &quot;2021-01-15T14:00:00&quot;;
      end.timeZone = &quot;Pacific Standard Time&quot;;
      event.end = end;
      Location location = new Location();
      location.displayName = &quot;&quot;;
      event.location = location;
      LinkedList&lt;Attendee&gt; attendeesList = new LinkedList&lt;Attendee&gt;();
      Attendee attendees = new Attendee();
  
      EmailAddress emailAddress = new EmailAddress();
      emailAddress.address = &quot;abc@gmail.com&quot;;
      emailAddress.name = &quot;Abcd&quot;;
      attendees.emailAddress = emailAddress;
      attendees.type = AttendeeType.REQUIRED;
      attendeesList.add(attendees);
  
      event.attendees = attendeesList;
      
      graphClient.me().calendar().events().buildRequest().post(event);
  
      log.info(&quot;created the event&quot;);
  
  }
  </code></pre>