delegation REST Stopped Working
Friday, November 4, 2022 at 06:41amI have code that follows which I have used to setup delegation for various users. All of the sudden users no longer have delegated access and using the code reports it setup delegation but it doesn't work. We have a main account where users are created, they are assigned rights in a subaccount and in that subaccount is the "user" where I setup delegation. Has the API call changed at all?
StringContent tmpDelegationpayload2 = new StringContent(subaccountId, System.Text.Encoding.UTF8, "application/json");
response = await tempDelegateClient.PostAsync(new Uri($"{baseURL}/api/account/senders/{MatchingSourceuser.AccountID}/delegates/{MatchingTargetUser.AccountID}"), tmpDelegationpayload2);
Assume the values in the commands are correct because they code is unchanged and has worked for a couple years. People who had delegation lost their access also, so it was fine? Do I need to add something to make it work again and restore the people who no longer have access ?
Reply to: delegation REST Stopped Working
Friday, November 4, 2022 at 09:23amHi Richard,
Just did a quick test and looks like both below two APIs works for me:
(1)POST /api/account/senders/dYCOOx6FJGgJ/delegates/S05qBPhbjukH
Note that I didn't really send the subaccount ID as the payload, instead, the API Key I am using is the subaccount level API Key, instead of the main account level API Key
(2)POST /api/account/delegates/dYCOOx6FJGgJ
With payload:
[
{
"id": "fpy5BwvR2n8D"
},
{
"id": "S05qBPhbjukH"
}
]
This second API seems to be newly introduced, which allows to add multiple delegates in one call. Again, I didn't specify the subaccount somewhere, but to use the subaccount level API Key.
Duo
Reply to: delegation REST Stopped Working
Friday, November 4, 2022 at 09:29amI just found that the problem happens when doing things via the UI so it must not be related to the API. Sorry for the distraction. Thank you for the answer.