Difference between revisions of "API Get Tags"
From zFairs Contest Management
(Created page with "== Get Tags == You can use the zFairs api to get a list of existing tags which can be set on a person or project (entry). This api call will provide you a list of existing tag...") |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
headers:{'Content-Type': 'application/json'}, | headers:{'Content-Type': 'application/json'}, | ||
body: JSON.stringify({ | 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 | FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f | ||
Body: {} | Body: {} | ||
Line 15: | Line 14: | ||
}) | }) | ||
.then(response => response.json()) | .then(response => response.json()) | ||
− | .then(data=>{console.log('Success: ',data);}) | + | .then(data=>{console.log('Success: ',data, data.Body); }) |
.catch((error)=>{console.log('Error: ', error);}); | .catch((error)=>{console.log('Error: ', error);}); | ||
Line 25: | Line 24: | ||
{ | { | ||
− | tags : | + | tags : { |
− | + | personTags: [{ | |
− | + | Id: 3, | |
− | + | Value "Best Judge Ever"}, { | |
− | + | Id: 4, | |
− | + | Value "Bald"}, | |
− | + | ... | |
− | + | ], | |
− | + | projectTags: [{ | |
− | + | Id: 31, | |
− | + | Value "Review Needed"}, { | |
− | + | Id: 14, | |
− | + | Value "Excellent"}, | |
− | + | ... | |
− | + | ] | |
− | + | } | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | |||
+ | <br/><br/><br/><br/> | ||
+ | [[Category: API]] |
Latest revision as of 21:53, 10 April 2024
Get Tags
You can use the zFairs api to get a list of existing tags which can be set on a person or project (entry). This api call will provide you a list of existing tags.
fetch('/api/data/tags', {
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, data.Body); })
.catch((error)=>{console.log('Error: ', error);});
This will return an object like so
{
tags : {
personTags: [{
Id: 3,
Value "Best Judge Ever"}, {
Id: 4,
Value "Bald"},
...
],
projectTags: [{
Id: 31,
Value "Review Needed"}, {
Id: 14,
Value "Excellent"},
...
]
}
}