Difference between revisions of "API Get participants"

From zFairs Contest Management
(Created page with "== Get Participants == Get a list of participants from our API. <syntaxhighlight lang="JavaScript" line> fetch('/api/data/participants', { method:'POST', headers:{'C...")
 
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
 
     headers:{'Content-Type': 'application/json'},
 
     headers:{'Content-Type': 'application/json'},
 
     body: JSON.stringify({
 
     body: JSON.stringify({
             Username:'admin username',
+
             ApiKey:'<Private key>',
            Password: 'password',
 
 
             FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
 
             FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
 
             Body: {}
 
             Body: {}
Line 19: Line 18:
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
 +
<br/><br/><br/><br/>
 +
[[Category: API]]

Latest revision as of 21:51, 10 April 2024

Get Participants

Get a list of participants from our API.

fetch('/api/data/participants', {
    method:'POST',
    headers:{'Content-Type': 'application/json'},
    body: JSON.stringify({
            ApiKey:'<Private key>',
            FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
            Body: {}
        })
})
.then(response => response.json())
.then(data=>{console.log('Success: ',data);})
.catch((error)=>{console.log('Error: ', error);});