浏览代码

Return contact id

Son NK 5 年之前
父节点
当前提交
81b5e919a3
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 3 0
      README.md
  2. 1 0
      app/api/views/alias.py

+ 3 - 0
README.md

@@ -929,6 +929,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,
@@ -937,6 +938,7 @@ If success, 200 with the list of contacts, for example:
       "reverse_alias": "marketing at example.com <reply+bzvpazcdedcgcpztehxzgjgzmxskqa@sl.co>"
     },
     {
+      "id": 2,
       "contact": "newsletter@example.com",
       "creation_date": "2020-02-21 11:35:00+00:00",
       "creation_timestamp": 1582284900,
@@ -966,6 +968,7 @@ Return 409 if contact is already added.
 
 ```
 {
+  "id": 1,
   "contact": "First Last <first@example.com>",
   "creation_date": "2020-03-14 11:52:41+00:00",
   "creation_timestamp": 1584186761,

+ 1 - 0
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,