API resend welcome mail is POST type but does not accept any post data

  • 2
  • Question
  • Updated 3 months ago
The API call https://accountname.sf-api.eu/sf/v3/Users(id)/ResendWelcome
to re-send the welcome mail is a POST call. It has an id param (in the url) and a customMessage param.
However, when trying to send this customMessage as a post variable (either www-encoded or json), it does not work.
It only works when adding it with a ?customMessage=xyz to the URL.
So it's a POST call but without any contents.
Would it be possible to add the processing of the customMessage when sent in the POST data as well? Otherwise there is no reason for this api call to be of POST type.

I hope that some day any api url could be used as POST, to work around the uri length limit.

Photo of Maarten

Maarten

  • 20 Posts
  • 2 Reply Likes

Posted 4 months ago

  • 2
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Hi Maarten,

You are right, this should accept the custom message property via the Body and not a query string. We cannot modify the original endpoint, but it should be straight forward to add an overloaded version that uses a body param. I'll work on that and update you, it should be around 2 weeks for it to be available to you. Thank you for your patience.

Best!
Eli
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Maarten,

To add to my reply, I may have jumped the gun a bit with saying it would be "straightforward" to make this change. While I agree with you this is the way the endpoint should work, there are a couple challenges in accepting a value in multiple ways (query string + body), so we'll discuss the implications with the team and see how we can work around it, or if we can consider this for a future version of the API. I'll keep you posted.

Thanks,
Eli
Photo of Maarten

Maarten

  • 20 Posts
  • 2 Reply Likes
Thanks, Eli
Regarding Dale's reply: I think for consistency this could be done in the same way as for e.g. the api callĀ Get List of Accounts for User (in Accounts).
There, it states:
Retrieve the list of Accounts associated with a given user. All parameters to this call may be passed in the Post body as root JSON parameters, or in the URI - with the exception of password that must be provided in the POST body. This operation does not require authentication
Or the Create AccessControl POST call, which mentions (Note: the first sentence of this quote is probably not correct, both grammar and meaning) :
Message sent of other principals with rights on the modified Item. This parameter can be sent as a URI param, or as part of the JSON description, added to the AccessControl element described there.
Documenting the behavior is essential here.

But let's not forget that it's even possible to supply the same param twice if it's only allowed in the uri and likewise with a body-only param. Would it then be the first, the last, a concatenation, etc., or throw an error.
Accepting as body data in json would not break contract for implementations currently using uri and not sending any data in body.

Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Hi Marteen,

Wanted to provide an update for this request. The team ultimately decided it would be best to create a brand new endpoint for this functionality that better adheres to RESTful principles, such as accepting the parameter via json body. We will do a "soft" deprecation of ResendWelcome by recommending the use of the new endpoint, but it will continue to be supported as is. Right now we are targeting the week of 9/10 to have this released, I'll confirm with you once it's available.

Best!
Eli
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 732 Posts
  • 102 Reply Likes
Hi Marteen,

It's been a little while, but wanted to update on my post below. The new endpoint is ready for release, it'll be used as follows:

POST https://account.sf-api.com/sf/v3/Users(id)/WelcomeNotification
{
"CustomMessage": "Your message"
}

We expect it to be available by the end of next week.

Thanks,
Eli
(Edited)
Photo of Maarten

Maarten

  • 20 Posts
  • 2 Reply Likes
Thanks for the update!