Error 400: Bad Request received when attempting to update email address via the API.

  • 1
  • Problem
  • Updated 10 months ago
When attempting to update a recipient's email address via the API, I am receiving a HTML 400: Bad Request error as a response.  I am able to update all other fields/attributes for a recipient record, just not that one.  I am aware of the note in the API documentation that indicates the email field can only be updated using a PUT request.  I have attempted to make the change using both the EmmaPython wrapper module and by hand-crafting a PUT request via the python request module.  In either case, I receive the 400 error.
Photo of Matt Nolley

Matt Nolley

  • 3 Posts
  • 0 Reply Likes
  • puzzled

Posted 11 months ago

  • 1
Photo of Grey Stepp

Grey Stepp, Support Team Manager

  • 1695 Posts
  • 135 Reply Likes
Hey there Matt, 

Thanks for reaching out!  

Does the address that you're trying to change it TO already exist in the audience of the account?   Email addresses are the unique identifier in the account, and there's not a way to duplicate or have 2 records that are the same address in the system.  

- G
Photo of Matt Nolley

Matt Nolley

  • 3 Posts
  • 0 Reply Likes
Thanks for the response!

The email addresses that I'm attempting to assign do not already exist within Emma.  Further, I encounter this issue anytime I attempt to update an email address via the API - not just for some cases.

Our use case: prospective students are added to Emma using their personal email address.  Once they have matriculated and enrolled, we update their accounts to reflect their new university email addresses.  In the past, we've made those updates manually. 

We've verified that we can manually change the email of an account for which we received the 400 when attempting the change via the API.
(Edited)
Photo of Matt Nolley

Matt Nolley

  • 3 Posts
  • 0 Reply Likes
After further digging, we have realized that you are in fact correct, Grey, although the specifics are frustrating.  First, I was able to find same cases in which I could change an user's email address.  That, combined with other users having similar problems updating these same recipients email addresses from the web UI, led to the discovery that another team member had mistakenly, originally uploaded all the incoming students, using predicted university email addresses.  They realized that was a mistake, deleted those profiles, and recreated them using the personal email addressees instead.  Those deleted recipient profiles appear to get placed in some kind of expiration queue, not fully deleted, but with their email addresses not available for reuse.   I was unaware of that behavior, assuming I am understanding it correctly.  Also, I do not see a way to 'undelete' these profiles through the API.  Am I overlooking something?
Photo of Ben Harrington

Ben Harrington, Employee

  • 112 Posts
  • 12 Reply Likes
Hey Matt,

If you want to remove the contacts from archive, you just need to submit a POST with all of the included addresses that need to be unarchived and that should pull them back as active contacts into the account.

-Ben