Difference between revisions of "API Set Project Id"

From zFairs Contest Management
 
(2 intermediate revisions by one other user not shown)
Line 10: Line 10:
 
     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 24: Line 23:
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
If you want to remove the fixed id you set just set the value of FixedId to null FixedId:null
 +
 +
*The body of the posted data is an array so you can update multiple project Id's at once.
  
 
[[Category: API]]
 
[[Category: API]]

Latest revision as of 21:57, 10 April 2024

Set Project Id

You can use our api to set an entry's or projects Id. To do this you need to POST a message to your site. Below is an example of what needs to be posted.

If you only want to update a project see API Update Project

fetch('/api/data/setFixedId', {
    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: [{
                   ProjectKey: '36 char GUID',
                   FixedId: 'Your Id'
            },...]
        })
})
.then(response => response.json())
.then(data=>{console.log('Success: ',data);})
.catch((error)=>{console.log('Error: ', error);});

If you want to remove the fixed id you set just set the value of FixedId to null FixedId:null

  • The body of the posted data is an array so you can update multiple project Id's at once.