You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
Home > HappyFox Service Desk > Developers > Requester APIs > API to change requester email address
API to change requester email address
print icon

API Endpoint

{account_url}/api/v2/public/requesters/actions/change-email/

Method

POST
Request Data

Change requester email address

 

Parameters

Parameter Description
requester_id   ID of the requester for whom email needs to be updated
from_email Existing email address of the requester which needs to be updated
to_email New email address which needs to be set

Note

  • Either requester_id or from_email is mandatory
  • to_email is mandatory.
  • If a requester with email id that matches to_email parameter is found, response will be an error.

Sample Response

Success Response: Status code 200

{
    "id": 25641,
    "name": "lisa taylors",
    "email": "lisa.taylors@happyfox.com",
    "phones": [
        {
            "id": 23634,
            "type": "mobile",
            "number": "+168621326920"
        }
    ],
    "custom_fields": [
        {
            "id": 1,
            "name": "CCF 3",
            "type": "t",
            "value": "New"
        },
    ],
    "primary_phone": {
        "id": 23634,
        "type": "mobile",
        "number": "+368621326920"
    },
    "created_at": "2023-06-26T13:55:25Z",
    "updated_at": "2023-06-28T02:08:22Z"
}

 

Error Response(s)

Case 1: When both requester_id and from_email is not present in the request.

{
    "non_field_errors": [
        "Either from_email or requester_id is required."
    ]
}

Case 2: When requester with from_email is not present

{
    "from_email": [
        "Requester with email john@gmail.com does not exist."
    ]
}

Case 3: When requester with requester_id is not present.

{
    "requester_id": [
        "Requester with id 100 does not exist."
    ]
}

Case 4: When requester with to_email is already present.

{
    "to_email": [
        "Requester with email lisa.taylors@gmail.com already exists."
    ]
}

Case 5: When requester with to_email is already present in pending status.

{
    "to_email": [
        "Requester with email lisa.taylors@gmail.com already exists in pending status"
    ]

Case 6: When trying to update a redacted requester.

Response code: 403

{
    "detail": "You do not have access to this contact"
}

 

Feedback
0 out of 1 found this helpful

scroll to top icon