We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

Unable to access office 365 email from cloud email ClientAccount sextion


We are trying to get emails from office 365 account and download them in .msg format.
when we tried the email/as-file endpoint the resultant .msg file is not valid after passing email body received from microsoft graph API.
we wanted to try with [ClientAccount] (https://apireference.aspose.cloud/email/#/ClientAccount) and ClientMessage to login and retrieve the emails.
the login SMTP credentials are not working. we have 2 problems.

  1. microsoft gives us tennent id and that field is not available in aspose
  2. microsoft is not giving us refresh token which is required in aspose.
    we tried passing tennant id to refresh token and we got the following error:
    “requestId”: “12b61c8f-4228-4935-afc9-b481d9b75124”,
    “error”: {
    “code”: “”,
    “message”: “Deserialization error”,
    “description”: “”,
    “dateTime”: “2022-11-14T10:42:41.8155398Z”

Can you please suggest some resource that enables accessing email account provided by office 365.

Thanks & regards,


Please note that you need to implement OAuth support on your side to get a Client Id and access token.

When you implement OAuth successfully, you will get both an access token and refresh token. A refresh token will be used by our API to obtain new tokens, when they are needed.

For example, when you get the access token, the response from the OAuth server will look like

  "scope":"ActivityFeed.Read ActivityReports.Read ServiceHealth.Read",

As you can see, there is an access_token, that expires in 3599 seconds. But also there is a refresh_token. This refresh token is used to obtain new access tokens, when previous access_tokens are expired.

During the implementation of OAuth on your side, you will find out, how to use other authentication fields (such as client_id). Hopefully, it will help you accomplish the task.

thankyou @tilal.ahmad. will try using the refresh token token we receive with the barer token along with application ID and client secret

1 Like