DevDocs

Add Contact

URI:                                       https://pyuaraxvi2.execute-api.us-east-1.amazonaws.com/dev/addcontact

Method:                              POST

Sample Payload:              {"phoneNumber":"+91 8800801880","email":"xyz@abc.com"}

 

Success Message:

{"code":200,"message":"Insert Successful"}

 

Error Message:

If both phoneNumber and email not provided in payload

{"code":"400","message":"Phone number or email either of one is required"}

 

If name not provided in payload

{"code":400,"message":"Name cannot be empty"}

 

In case of any exception

{"code":500,"message":}

 

Edit Contact

URI:                                       https://pyuaraxvi2.execute-api.us-east-1.amazonaws.com/dev/editcontact

Method:                              POST

Sample Payload:              {"contactId":1,"phoneNumber":"+91 8800801880","email":"xyz@abc.com"}

 

Success Message:

{"code":200,"message":"Update Successful"}

 

Error Message:

Not authorised user

{"code":400,"message":"You are not authorised contact doesn't belong to you"}

 

If contactId missing

{"code":400,"message":"contactId missing or not valid"}

 

In case of any exception

{"code":500,"message":}

 

Delete Contact

URI:                                       https://pyuaraxvi2.execute-api.us-east-1.amazonaws.com/dev/deletecontact

Method:                              POST

Sample Payload:              {"contactId":1}

 

Success Message:

{"code":200,"message":"Delete Successful"}

 

Error Message:

Not authorised user

{"code":400,"message":"You are not authorised contact doesn't belong to you"}

 

In case of cotactId not provided

{"code":400,"message":"No contact Id found or wrong contact id"}

 

In case of any exception

{"code":500,"message":}

 

Get Contact

URI:                                       https://pyuaraxvi2.execute-api.us-east-1.amazonaws.com/dev/getcontact

Method:                              POST

Sample Payload:              {"contactId":1}

 

Success Message:

{"code":200,

 "message":"Get Successful"

 "data": [

{

"contactId":1,

"phoneNumber":"+91 8800801880",

email":"xyz@abc.com

}

]

}

 

Error Message:

Not authorised user

{"code":400,"message":"You are not authorised contact doesn't belong to you"}

 

In case of cotactId not provided

{"code":400,"message":"No contact Id found or wrong contact id"}

 

In case of any exception

{"code":500,"message":}

 

Get Contact List

URI:                                       https://pyuaraxvi2.execute-api.us-east-1.amazonaws.com/dev/getcontactlist

Method:                              POST

Sample Payload:              {}

 

Success Message:

{"code":200,

 "message":"Get Successful"

 "data": [

{

"contactId":1,

"phoneNumber":"+91 8800801880",

email":"xyz@abc.com

},

{

"contactId":2,

"phoneNumber":"+91 8802801880",

email":"dss@abc.com

}

 

]

}

 

Error Message:

No Data message

 

{"code":400,"message":"You have not added any contact"}

 

In case of any exception

{"code":500,"message":}