Upsert event¶
- URL: [Base URL]/users/
- Method: POST
- Content-type:
application/json
Example¶
Let's assume the following configuration:
- Endpoint URL is set in the client panel to:
https://testing.mydomain.com/socialwifi/ - Authorization is Basic Auth with username
socialwifiand passwordpassword.
TheAuthorizationheader value in the client panel should be set to:Basic c29jaWFsd2lmaTpwYXNzd29yZA==
You can simulate the request that Social WiFi would do, with the following
curl command:
curl \
-X POST https://testing.mydomain.com/socialwifi/users/ \
-H "Authorization: Basic c29jaWFsd2lmaTpwYXNzd29yZA==" \
-H "Content-Type: application/json" \
-H "User-Agent: Social WiFi" \
-d \
'{"data": {"user": {"id": "c9ad3b6d-3f13-4797-960a-43ca88c8e217",
"email": "testing@socialwifi.com", "first-name": "John",
"last-name": "Doe", "phone": "+44123123123", "language": "en", "birth-date": "1980-05-20",
"gender": "male", "is-subscribed": true}, "venue": {"id":
"1ba1cf60-4f49-46c6-b276-56bc2f3e8a4a", "name": "My Test Venue",
"address": "9450 Oakland Ave", "city": "Blacksburg", "country":
"USA", "created-at": "2019-09-18T11:26:12.317583+00:00"},
"user-venue-history": {"visits-count": 5, "first-visit-on":
"2019-01-11T17:42:58.300355+00:00", "last-visit-on":
"2019-03-11T15:51:14.300355+00:00"}, "user-venue-agreements":
{"accepted-date": "2019-01-11T17:42:58.300355+00:00", "texts":
["Agreement 1 text", "Agreement 2 text"]}}}'
Pretty-printed JSON:
{
"data": {
"user": {
"id": "c9ad3b6d-3f13-4797-960a-43ca88c8e217",
"email": "testing@socialwifi.com",
"email-confirmed": true,
"first-name": "John",
"last-name": "Doe",
"phone": "+44123123123",
"phone-confirmed": true,
"language": "en",
"birth-date": "1980-05-20",
"gender": "male",
"is-subscribed": true
},
"venue": {
"id": "1ba1cf60-4f49-46c6-b276-56bc2f3e8a4a",
"name": "My Test Venue",
"address": "9450 Oakland Ave",
"city": "Blacksburg",
"country": "USA",
"created-at": "2019-09-18T11:26:12.317583+00:00"
},
"user-venue-history": {
"visits-count": 5,
"first-visit-on": "2019-01-11T17:42:58.300355+00:00",
"last-visit-on": "2019-03-11T15:51:14.300355+00:00"
},
"user-venue-agreements": {
"accepted-date": "2019-01-11T17:42:58.300355+00:00",
"texts": [
"Agreement 1 text",
"Agreement 2 text"
]
}
}
}