Announcement

Collapse
No announcement yet.

REST API - Updating email fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • REST API - Updating email fields

    I'm trying to use the REST API (via Postman, for now) to update fields on an Email, and strangely, the changes aren't taking. I'm using the API Key method rather than HMAC.

    For instance, I can make a GET request to /api/v1/Email/aaaBBBccc successfully and receive all details about an email that was sent to a shared mailbox. Let's say the response looks something like this:

    Code:
    {
       "id": "aaaBBBccc ,
       "name": "email test",
       "deleted": false,
       "subject": "email test",
       "fromName": "MAveryWeir",
       "fromAddress": "MAveryWeir@example.com",
       "bodyPlain": "Lorem ipsum",
    ...
    }
    If I make a PUT request, however, I get a 200 response, but the data in the email object doesn't change. The content type is application/json, the API key is set on X-Api-Key, and the body is:

    Code:
    {
        "bodyPlain": "help",
        "name": "api test"
    }
    Despite the 200 response, calls to GET the email (or looking in the UI) show no changes to those fields. This API user's role has permission to the Email scope, with yes/all/all/all to Create/Read/Edit/Delete. External Account scope is also enabled, as is the Personal Emails Account scope.

    At the Field level, this user's role has permission to read and edit both the "Body (Plain)" and "Name (Subject)" fields.

    I must be missing something obvious, but why isn't a PUT request having any effect?

  • #2
    Hi there,
    it is not supported to update those fields through API. Basically, the API requests from Postman or Curl etc. work the same way as you would make the same action through UI. So if you cannot change some data via UI, then you cannot change it by a correspondent API request.

    Comment


    • #3
      That's a bummer. Is the only way to update those fields to use Formulas?

      Comment


      • #4
        I didn't try but I doubt it would work.

        Comment


        • #5
          Okay, that explains some of my trouble working with Formulas, then. I think for my purposes, I'll end up accessing and modifying the DB directly in response to a webhook, if inbound emails to a shared account will trigger a webhook call.

          Comment

          Working...
          X