(Incoming) Update - mobile app

This event is sent to your server when a player try to update a contact from the mobile application.

WebSocket event

Event name: contacts@update

⚠️ Response required / expires after 60 seconds

Event data received

KeyTypeDescription
custom_idstringUnique identifier from your services (1-64 characters)
contact_uidstringUnique contact identifier that need to be updated (1-32 characters)
contactIncomingContactPayloadContact payload with updated data

Expected WebSocket response

You need to emit an event with the following name and data:

Response event name: contacts@update/response

Response object

KeyTypeExtraDescription
custom_idstring
required
Unique identifier from your services (1-64 characters)
contactContact
required
contact object

Important

Response object must respect every type rule. If any structure isn't respected, your request will be rejected for "bad-request".

Response example

I received a request for the following custom_id = 1234 and contact_number = "555-6671"

My response will be:

{
  "custom_id": "1234",
  "contact": {
    "uid": "8756",
    "displayName": "Hank <3",
    "number": "555-6671"
  }
}

Response error

You must notify iPear if the data does not comply with your verification processes. Response Error event name: contacts@update/error

Parameters

KeyTypeExtraDescription
custom_idstring
required
Unique identifier from your services (1-64 characters)
contact_uidContact
required
Unique id of the contact to update (1-32 characters)
errorstring (Error list)
required
Available errors for this case: player-not-found, contact-not-found, contact-already-exist, unknown

Example

My player with the following ID: 1234 has no contact details with the UID 8756

{
  "custom_id": "1234",
  "contact_uid": "8756",
  "error": "contact-not-found"
}

What's next?

Incoming events

Outgoing events

Powered by Doctave