Unsupported Content Type Error (415) When Calling Microsoft Graph API in Freshdesk Custom App V3

Dear Freshdesk Developer Community,

I’m currently facing an issue with a Microsoft Graph API call in a Freshdesk V3 Custom App. Specifically, I’m attempting to retrieve a user’s profile image using the following endpoint:
https://graph.microsoft.com/v1.0/users/{emailId}/photo/$value

The request works as expected in Postman, with or without Accept headers:
Accept: image/jpeg

However, when attempting the same request within the Freshdesk app, it returns a 415 error with “Unsupported content type”:

{
  "status": 415,
  "headers": {},
  "response": "Unsupported content type",
  "errorSource": "APP",
  "attempts": 1
}

Details:

It would be very helpful to know if Freshdesk has specific limitations or requirements around Content-Type when handling image data or binary content. Any insights or suggestions for workarounds would be much appreciated.

Thank you in advance for your help and guidance.

Hey @Kiran,
Thanks for bringing this to our notice.
Can you share your requests.json for this GET API and the postman’s curl command?

Hi @zach_jones_noel ,

Thanks for the response.

Here’s the request.json I’m working with:

"getUserPhoto": {
    "schema": {
      "method": "GET",
      "protocol": "https",
      "host": "graph.microsoft.com",
      "path": "/v1.0/users/<%= context.emailId %>/photo/$value",

      "headers": {
        "Authorization": "Bearer <%= context.msToken %>",
        "Accept": "image/jpeg"
      }
    }
  },
"microsoftGraphAuthenticate": {
    "schema": {
      "method": "POST",
      "protocol": "https",
      "host": "login.microsoftonline.com",
      "path": "/<%= iparam.microsoft_graph_tenant_id %>/oauth2/v2.0/token",

      "headers": {
        "Content-Type": "application/x-www-form-urlencoded"
      }
    }
  }

I’ve tried including or excluding the Accept and Content-Type headers, but the response remains the same.

Here’s the cURL command from Postman for reference:

curl --location 'https://graph.microsoft.com/v1.0/users/test@testmail.com.au/photo/$value' \
--header 'Authorization: Bearer ••••••'

The OAuth token used here is from the Freshdesk custom app, which I copied to Postman for testing.

Regards,
Kiran

Hey @Kiran,
The request method only supports the mentioned content-types -
application/json, application/xml, text/html, text/xml, application/jsonp, text/plain, text/javascript and application/vnd.api+json.

Alternatively, you can use SMI with external npm libraries like axios to make API calls.