From 9ae6ba323c0c4ded9786eef6b8169cdefb6ca109 Mon Sep 17 00:00:00 2001 From: Son NK Date: Tue, 17 Mar 2020 12:38:50 +0100 Subject: [PATCH] Return contact id --- README.md | 3 +++ app/api/views/alias.py | 1 + 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index b2d63e71..de9c4b86 100644 --- a/README.md +++ b/README.md @@ -946,6 +946,7 @@ If success, 200 with the list of contacts, for example: { "contacts": [ { + "id": 1, "contact": "marketing@example.com", "creation_date": "2020-02-21 11:35:00+00:00", "creation_timestamp": 1582284900, @@ -954,6 +955,7 @@ If success, 200 with the list of contacts, for example: "reverse_alias": "marketing at example.com " }, { + "id": 2, "contact": "newsletter@example.com", "creation_date": "2020-02-21 11:35:00+00:00", "creation_timestamp": 1582284900, @@ -983,6 +985,7 @@ Return 409 if contact is already added. ``` { + "id": 1, "contact": "First Last ", "creation_date": "2020-03-14 11:52:41+00:00", "creation_timestamp": 1584186761, diff --git a/app/api/views/alias.py b/app/api/views/alias.py index 25ac419f..30938cd6 100644 --- a/app/api/views/alias.py +++ b/app/api/views/alias.py @@ -202,6 +202,7 @@ def update_alias(alias_id): def serialize_contact(fe: Contact) -> dict: res = { + "id": fe.id, "creation_date": fe.created_at.format(), "creation_timestamp": fe.created_at.timestamp, "last_email_sent_date": None,