Skip to main content

API

Thread needs solution
Beginner
Posts: 1
Comments: 1

For the following attachment, in line 92, we tried to obtain HttpStatusCode. However, the output is shown as MethodNotAllowed. Is there any possible solution for this scenario?

p.s. our code is written in C#.

Regrads,

F.L

0 Users found this helpful
Acronis engineer
Posts: 0
Comments: 84

Hello Freddy Lin,

Thank you for your post.

May I ask what is the exact method that you request in your code? Is it a GET method?

Overall the getToken() method looks correctly defined but we don't understand from whole code if GET or POST is used. The call to request an access token uses a POST method, or POST /api/2/idp/token, please review https://developer.acronis.com/doc/account-management/v2/reference/index… as well. So, the only reason for me if the method itself is not POST but rather a GET.

You can also share the complete response from API that is thrown for response.StatusCode and response.Content to see the exact code and error message given back from our side.

Thank you in advance.

Beginner
Posts: 1
Comments: 1

Dear Ivaylo Tsvetkov,

Thank you for the reply!

In line 88, the code did use Post. 

The following is the only response we got from the API.

This API used to work fine. The only difference was that we have a different clientID, Secret, and a new base URL.

 

Will the server location(sg or tw) make any difference?

 

Regards,

F.L.  

Acronis engineer
Posts: 0
Comments: 84

Hello Freddy Lin,

Thank you, I see the method now, POST is correct one.

Yes, server location or DC matters, you can't use an API Client created in SG into TW and the opposite. You should dedicate separate Clients for each location and make sure you send the call to the respective URL.

Though, I still don't think a "Method Not Allowed" will thrown if URL or Client is wrong.

If still failing, please share the complete request/response pulled out from your integration's logs.

Thank you!