InvalidRequest: Missing header Client-Request-Id. Header Client-Request-Id is not a guid
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the POST request to the workbook/comments endpoint from the AddComment example, including its Client-Request-Id header, and compare the request sent by Graph Explorer and the JavaScript client. Done means determining whether the Java SDK changes or drops the GUID header, or whether the rejection comes from the Graph API itself; no repository file or test is named in the report.
Written by the indexing model from the issue text.
Description
Graph API End point:
POST https://graph.microsoft.com/v1.0/drive/items/{item-id}/workbook/comments
Request Body:
{
"content": "This is a sample text"
}
I am passing GUID in the Client-Request-Id but still the issue remains same.
When posting comments to a word document using graph Client getting
Error message: {"code":"InvalidRequest","message":"Missing header Client-Request-Id. Header Client-Request-Id is not a guid.","innerError":{"request-id":"00000000-0000-0000-0000-000000000000","date":"2024-09-20T17:03:58.6112675-07:00"}}
I tried using GraphExplorer,JavaCode(Refer Below),JavaScriptClient and everywhere the issue remains same.
import java.util.UUID;
import org.apache.hc.client5.http.classic.methods.HttpPost;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.io.entity.StringEntity;
public class AddComment {
public static void main(String[] args) {
try {
String url = "https://graph.microsoft.com/v1.0/sites/" + "my-site-id" + "/drives/" + "my-drive-id" + "/items/" + "item-id" + "/workbook/comments";
String clientRequestId = UUID.randomUUID().toString(); // Generate a new GUID
CloseableHttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(url);
post.setHeader("Authorization", "Bearer access-token");
post.setHeader("client-Request-Id", clientRequestId);
post.setHeader("Content-Type", "application/json");
String json = "{\"content\": \"MS Document Comment\"}";
StringEntity entity = new StringEntity(json);
post.setEntity(entity);
CloseableHttpResponse response = client.execute(post);
String responseBody = EntityUtils.toString(response.getEntity());
System.out.println(response.getCode());
System.out.println(responseBody);
client.close();
// Handle the response...
} catch (Exception e) {
e.printStackTrace();
}
}
}
- Dominant language
- Java
- Stars
- 444
- Forks
- 154
- Avg merge
- 18h 28m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
status:waiting-for-triage type:bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 comment ·
All issues in microsoftgraph/msgraph-sdk-java
Similar issues
-
certification
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Openbug ecr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Needs: Triage Type: Feature request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2760 ·