curl -X POST " https://api.playground.try.be/customers/check-ins " \
-H " Authorization: Bearer YOUR_API_KEY " \
-H " Accept: application/json " \
-H " Content-Type: application/json " \
-d ' {
"customer_id": "000000-000000-000000-000000",
"membership_id": "000000-000000-000000-000000",
"site_id": "000000-000000-000000-000000",
"method_id": "scanned",
"method_type": "gantner"
} ' const response = await fetch ( ' https://api.playground.try.be/customers/check-ins ' , {
method : ' POST ' ,
headers : {
Authorization : ' Bearer YOUR_API_KEY ' ,
' Content-Type ' : ' application/json ' ,
Accept : ' application/json ' ,
},
body : JSON . stringify ( {
" customer_id " : " 000000-000000-000000-000000 " ,
" membership_id " : " 000000-000000-000000-000000 " ,
" site_id " : " 000000-000000-000000-000000 " ,
" method_id " : " scanned " ,
" method_type " : " gantner "
} ) ,
} )
if ( ! response . ok ) {
throw new Error ( ` Trybe API ${ response . status } : ${ await response . text () }` )
}
const data = await response . json () import httpx
response = httpx . post (
" https://api.playground.try.be/customers/check-ins " ,
headers = {
" Authorization " : " Bearer YOUR_API_KEY " ,
" Accept " : " application/json " ,
" Content-Type " : " application/json " ,
},
json = {
" customer_id " : " 000000-000000-000000-000000 " ,
" membership_id " : " 000000-000000-000000-000000 " ,
" site_id " : " 000000-000000-000000-000000 " ,
" method_id " : " scanned " ,
" method_type " : " gantner "
},
)
response . raise_for_status ()
data = response . json () <? php
$ client = new \ GuzzleHttp \ Client ();
$ response = $ client -> request ( ' POST ' , ' https://api.playground.try.be/customers/check-ins ' , [
' headers ' => [
' Authorization ' => ' Bearer YOUR_API_KEY ' ,
' Accept ' => ' application/json ' ,
' Content-Type ' => ' application/json ' ,
],
' json ' => [
' customer_id ' => ' 000000-000000-000000-000000 ' ,
' membership_id ' => ' 000000-000000-000000-000000 ' ,
' site_id ' => ' 000000-000000-000000-000000 ' ,
' method_id ' => ' scanned ' ,
' method_type ' => ' gantner '
],
]);
$ data = json_decode ($ response -> getBody (), true ); package main
import (
" bytes "
" encoding/json "
" net/http "
)
func main () {
payload , _ := json . Marshal ( map [ string ] interface {}{
" customer_id " : " 000000-000000-000000-000000 " ,
" membership_id " : " 000000-000000-000000-000000 " ,
" site_id " : " 000000-000000-000000-000000 " ,
" method_id " : " scanned " ,
" method_type " : " gantner " ,
})
req , _ := http . NewRequest ( " POST " , " https://api.playground.try.be/customers/check-ins " , bytes . NewBuffer ( payload ))
req . Header . Set ( " Authorization " , " Bearer YOUR_API_KEY " )
req . Header . Set ( " Accept " , " application/json " )
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
var data map [ string ] interface {}
json . NewDecoder ( resp . Body ). Decode ( & data )
} 201 401 403 422
The check-in was successfully retrieved
{
" data " : {
" id " : " 000000-000000-000000-000000 " ,
" customer " : {
" id " : " 000000-000000-000000-000000 " ,
" first_name " : " John " ,
" last_name " : " Smith " ,
" full_name " : " John Smith " ,
" email " : " john@example.com "
},
" membership_id " : " 000000-000000-000000-000000 " ,
" site_id " : " 000000-000000-000000-000000 " ,
" method " : {
" name " : " Scanned "
},
" checked_in_at " : " 2021-01-01T00:00:00.000Z " ,
" checked_out_at " : " 2021-01-01T00:00:00.000Z "
}
} {
" message " : " Unauthenticated "
} {
" message " : " This action is unauthorized. "
} {
" errors " : {},
" message " : " The request didn't pass validation "
}