I can’t see any way in the API to list which requirements (i.e., achievement children) a scout has completed toward some achievement (like the requirements for a rank or merit badge). Also, there seems to be no way to determine which versions of the listed requirements are for which scouting year (e.g., 2015 vs 2016). Is this kind of visibility planned for the API? Thanks
I’m struggling with the idea that the main data available through the API seems to be extremely limited - mainly just the data that isn’t already available through the canned reports on TroopTrack. I have need for various combinations of data and would like to avoid a bunch of manual intervention via downloading and parsing site-generated .csv reports. Is there a reason why all data isn’t available via the API? The API is so close to be being great - it’s just missing some basic things like this.
Hi @mikethomson, I’m not really following you. Can you post the specific call you are making along with the result?
Hi @dave, I can post some of the calls I’m using if it becomes helpful, but I guess the main point I’m making is that there currently is not any API call that will provide data that I’m interested in at the moment; for example, the list of requirements that a scout has completed for a rank. Example:
- I can use /v1/user_achievements?user_id=xxxxxx to find out what ranks and merit badges have been earned or what percent complete they are
- But there appears to be no way to get finer granularity than that - I can’t get a list of the specific requirements that they have completed or that are remaining.
Another example:
- I can use /v1/achievements/xx?award_type_id=xxxxxx to get a list of requirements that are associated with an achievement (like rank or merit badge).
- However, since requirements for a rank can change ever few years, the list that is returned from the above query lists ALL requirements EVER associated with that rank, without being able to tell which ones correspond with different years (so there ends up being multiple #1, #2, etc requirements listed). Here’s example results for this one:
curl -X GET --header 'Accept: application/json' --header 'X-Partner-Token: xxxxxx' --header 'X-User-Token: xxxxxx' 'https://xxxxxx.trooptrack.com/api/v1/achievements/200?award_type_id=999999998'
Resulting output:
{
"achievement": {
"200": {
"name": "Second Class",
"description": "Rank",
"children": {
"1200": {
"achievement_id": 1200,
"name": "1a",
"description": "<p>Demonstrate how a compass works and how to orient a map. Explain what map symbols mean.</p>",
"children": []
},
"1201": {
"achievement_id": 1201,
"name": "1b",
"description": "<p>Using a compass and a map together, take a five-mile hike (or 10 miles by bike) approved by your adult leader and your parent or guardian. (Note: If you use a wheelchair or crutches, or if it is difficult for you to get around, you may substitute \"trip\" for \"hike.\")</p>",
"children": []
},
"1202": {
"achievement_id": 1202,
"name": "3a",
"description": "<p>Since joining, have participated in five separate troop/patrol activities (other than troop/patrol meetings), two of which included camping overnight.</p>",
"children": []
},
"1203": {
"achievement_id": 1203,
"name": "3b",
"description": "<p>On one of these campouts, select your patrol site and sleep in a tent that you pitched. Explain what factors you should consider when choosing a patrol site and where to pitch a tent.</p>",
"children": []
},
"1204": {
"achievement_id": 1204,
"name": "3c",
"description": "<p>Demonstrate proper care, sharpening, and use of the knife, saw, and ax, and describe when they should be used.</p>",
"children": []
},
"1205": {
"achievement_id": 1205,
"name": "3d",
"description": "<p>Use the tools listed in requirement 3c to prepare tinder, kindling, and fuel for a cooking fire.</p>",
"children": []
},
"1206": {
"achievement_id": 1206,
"name": "3e",
"description": "<p>Explain when it is appropriate to use a cooking fire. At an approved outdoor location and at an approved time, and using the tinder, kindling, and fuel wood from requirement 3d, demonstrate how to build a fire; light the fire, unless prohibited by local fire restrictions. After allowing the flames to burn safely for at least two minutes, safely extinguish the flames with minimal impact to the fire site.</p>",
"children": []
},
"1207": {
"achievement_id": 1207,
"name": "3f",
"description": "<p>Explain when it is appropriate to use a lightweight stove or propane stove. Set up a lightweight stove or propane stove; light the stove, unless prohibited by local fire restrictions. Describe the safety procedures for using these types of stoves.</p>",
"children": []
},
"1208": {
"achievement_id": 1208,
"name": "3g",
"description": "<p>On one campout, plan and cook one hot breakfast or lunch, selecting foods from the MyPlate food guide or the current USDA nutrition model. Explain the importance of good nutrition. Tell how to transport, store, and prepare the foods you selected.</p>",
"children": []
},
"1209": {
"achievement_id": 1209,
"name": "4",
"description": "<p>Participate in a flag ceremony for your school, religious institution, chartered organization, community, or troop activity. Explain to your leader what respect is due the flag of the United States.</p>",
"children": []
},
"1210": {
"achievement_id": 1210,
"name": "5",
"description": "<p>Participate in an approved (minimum of one hour) service project.</p>",
"children": []
},
"1211": {
"achievement_id": 1211,
"name": "6",
"description": "<p>Identify or show evidence of at least 10 kinds of wild animals (birds, mammals, reptiles, fish, mollusks) found in your community.</p>",
"children": []
},
"1212": {
"achievement_id": 1212,
"name": "7a",
"description": "<p>Show what to do for \"hurry\" cases of stopped breathing, serious bleeding, and ingested poisoning.</p>",
"children": []
},
"1213": {
"achievement_id": 1213,
"name": "7b",
"description": "<p>Prepare a personal first-aid kit to take with you on a hike.</p>",
"children": []
},
"1214": {
"achievement_id": 1214,
"name": "7c",
"description": "<p>Demonstrate first aid for the following:\n<br />* Object in the eye\n<br />* Bite of a suspected rabid animal\n<br />* Puncture wounds from a splinter, nail, and fishhook\n<br />* Serious burns (partial thickness, or second degree)\n<br />* Heat exhaustion\n<br />* Shock\n<br />* Heatstroke, dehydration, hypothermia, and hyperventilation\n</p>",
"children": []
},
"1215": {
"achievement_id": 1215,
"name": "8a",
"description": "<p>Tell what precautions must be taken for a safe swim.</p>",
"children": []
},
"1216": {
"achievement_id": 1216,
"name": "8b",
"description": "<p>Demonstrate your ability to jump feetfirst into water over your head in depth, level off and swim 25 feet on the surface, stop, turn sharply, resume swimming, then return to your starting place.</p>",
"children": []
},
"1217": {
"achievement_id": 1217,
"name": "8c",
"description": "<p>Demonstrate water rescue methods by reaching with your arm or leg, by reaching with a suitable object, and by throwing lines and objects. Explain why swimming rescues should not be attempted when a reaching or throwing rescue is possible, and explain why and how a rescue swimmer should avoid contact with the victim.</p>",
"children": []
},
"1218": {
"achievement_id": 1218,
"name": "9a",
"description": "<p>Participate in a school, community, or troop program on the dangers of using drugs, alcohol, and tobacco, and other practices that could be harmful to your health. Discuss your participation in the program with your family, and explain the dangers of substance addictions.</p>",
"children": []
},
"1219": {
"achievement_id": 1219,
"name": "9b",
"description": "<p>Explain the three R's of personal safety and protection.</p>",
"children": []
},
"1220": {
"achievement_id": 1220,
"name": "11",
"description": "<p>Demonstrate Scout spirit by living the Scout Oath and Scout Law in your everyday life. Discuss four specific examples (different from those used for Tenderfoot requirement 13) of how you have lived the points of the Scout Law in your daily life.</p>",
"children": []
},
"36008": {
"achievement_id": 36008,
"name": "2",
"description": "<p>Discuss the principles of Leave No Trace.</p>",
"children": []
},
"36009": {
"achievement_id": 36009,
"name": "10",
"description": "<p>Earn an amount of money agreed upon by you and your parent, then save at least 50 percent of that money.</p>",
"children": []
},
"36348": {
"achievement_id": 36348,
"name": "1a",
"description": "<p>Camping and Outdoor Ethics: Since joining, participate in five separate troop/patrol activities, three of which include overnight camping. These five activities do not include troop or patrol meetings. On at least two of the three campouts, spend the night in a tent that you pitch or other structure that you help erect (such as a lean-to, snow cave, or tepee).</p>",
"children": []
},
"36349": {
"achievement_id": 36349,
"name": "1b",
"description": "<p>Camping and Outdoor Ethics: Explain the seven principles of Leave No Trace and tell how you practiced them on a campout or outing. This outing must be different from the one used for \"Tenderfoot requirement 1c\".</p>",
"children": []
},
"36350": {
"achievement_id": 36350,
"name": "1c",
"description": "<p>Camping and Outdoor Ethics: On one of these campouts, select a location for your patrol site and recommend it to your patrol leader, senior patrol leader, or troop guide. Explain what factors you should consider when choosing a patrol site and where to pitch a tent.</p>",
"children": []
},
"36351": {
"achievement_id": 36351,
"name": "2a",
"description": "<p>Cooking and Tools: Explain when it is appropriate to use a fire for cooking or other purposes and when it would not be appropriate to do so.</p>",
"children": []
},
"36352": {
"achievement_id": 36352,
"name": "2b",
"description": "<p>Cooking and Tools: Use the tools listed in Tenderfoot requirement 3d to prepare tinder, kindling, and fuel wood for a cooking fire.</p>",
"children": []
},
"36353": {
"achievement_id": 36353,
"name": "2c",
"description": "<p>Cooking and Tools: At an approved outdoor location and time, use the tinder, kindling, and fuel wood from \"Second Class requirement 2b\" to demonstrate how to build a fire. Unless prohibited by local fire restrictions, light the fire. After allowing the flames to burn safely for at least two minutes, safely extinguish the flames with minimal impact to the fire site.</p>",
"children": []
},
"36354": {
"achievement_id": 36354,
"name": "2d",
"description": "<p>Cooking and Tools: Explain when it is appropriate to use a lightweight stove and when it is appropriate to use a propane stove. Set up a lightweight stove or propane stove. Light the stove, unless prohibited by local fire restrictions. Describe the safety procedures for using these types of stoves.</p>",
"children": []
},
"36355": {
"achievement_id": 36355,
"name": "2e",
"description": "<p>Cooking and Tools: On one campout, plan and cook one hot breakfast or lunch, selecting foods from MyPlate or the current USDA nutritional model. Explain the importance of good nutrition. Demonstrate how to transport, store, and prepare the foods you selected.</p>",
"children": []
},
"36356": {
"achievement_id": 36356,
"name": "2f",
"description": "<p>Cooking and Tools: Demonstrate tying the sheet bend knot. Describe a situation in which you would use this knot.</p>",
"children": []
},
"36357": {
"achievement_id": 36357,
"name": "2g",
"description": "<p>Cooking and Tools: Demonstrate tying the bowline knot. Describe a situation in which you would use this knot</p>",
"children": []
},
"36358": {
"achievement_id": 36358,
"name": "3a",
"description": "<p>Navigation: Demonstrate how a compass works and how to orient a map. Use a map to point out and tell the meaning of five map symbols.</p>",
"children": []
},
"36359": {
"achievement_id": 36359,
"name": "3b",
"description": "<p>Navigation: Using a compass and map together, take a 5-mile hike (or 10 miles by bike) approved by your adult leader and your parent or guardian.</p>",
"children": []
},
"36360": {
"achievement_id": 36360,
"name": "3c",
"description": "<p>Navigation: Describe some hazards or injuries that you might encounter on your hike and what you can do to help prevent them.</p>",
"children": []
},
"36361": {
"achievement_id": 36361,
"name": "3d",
"description": "<p>Navigation: Demonstrate how to find directions during the day and at night without using a compass or an electronic device.</p>",
"children": []
},
"36362": {
"achievement_id": 36362,
"name": "4",
"description": "<p>Nature: Identify or show evidence of at least 10 kinds of wild animals (such as birds, mammals, reptiles, fish, or mollusks) found in your local area or camping location. You may show evidence by tracks, signs, or photographs you have taken.</p>",
"children": []
},
"36363": {
"achievement_id": 36363,
"name": "5a",
"description": "<p>Aquatics: Tell what precautions must be taken for a safe swim.</p>",
"children": []
},
"36364": {
"achievement_id": 36364,
"name": "5b",
"description": "<p>Aquatics: Demonstrate your ability to pass the BSA beginner test: Jump feetfirst into water over your head in depth, level off and swim 25 feet on the surface, stop, turn sharply, resume swimming, then return to your starting place.</p>",
"children": []
},
"36365": {
"achievement_id": 36365,
"name": "5c",
"description": "<p>Aquatics: Demonstrate water rescue methods by reaching with your arm or leg, by reaching with a suitable object, and by throwing lines and objects.</p>",
"children": []
},
"36366": {
"achievement_id": 36366,
"name": "5d",
"description": "<p>Aquatics: Explain why swimming rescues should not be attempted when a reaching or throwing rescue is possible. Explain why and how a rescue swimmer should avoid contact with the victim</p>",
"children": []
},
"36367": {
"achievement_id": 36367,
"name": "6a",
"description": "<p>First Aid and Emergency Preparedness: Demonstrate first aid for the following:<ul>\n<br /><li>Object in the eye</li>\n<br /><li>Bite of a warm-blooded animal</li>\n<br /><li>Puncture wounds from a splinter, nail, and fishhook</li>\n<br /><li>Serious burns (partial thickness, or second-degree)</li>\n<br /><li>Heat exhaustion</li>\n<br /><li>Shock</li>\n<br /><li>Heatstroke, dehydration, hypothermia, and hyperventilation</li>\n<br /></ul></p>",
"children": []
},
"36368": {
"achievement_id": 36368,
"name": "6b",
"description": "<p>First Aid and Emergency Preparedness: Show what to do for “hurry” cases of stopped breathing, stroke, severe bleeding, and ingested poisoning.</p>",
"children": []
},
"36369": {
"achievement_id": 36369,
"name": "6c",
"description": "<p>First Aid and Emergency Preparedness: Tell what you can do while on a campout or hike to prevent or reduce the occurrence of the injuries listed in Second Class requirements 6a and 6b.</p>",
"children": []
},
"36370": {
"achievement_id": 36370,
"name": "6d",
"description": "<p>First Aid and Emergency Preparedness: Explain what to do in case of accidents that require emergency response in the home and backcountry. Explain what constitutes an emergency and what information you will need to provide to a responder.</p>",
"children": []
},
"36371": {
"achievement_id": 36371,
"name": "6e",
"description": "<p>First Aid and Emergency Preparedness: Tell how you should respond if you come upon the scene of a vehicular accident.</p>",
"children": []
},
"36372": {
"achievement_id": 36372,
"name": "7a",
"description": "<p>Fitness: After completing Tenderfoot requirement 6c, be physically active at least 30 minutes each day for five days a week for four weeks. Keep track of your activities.</p>",
"children": []
},
"36373": {
"achievement_id": 36373,
"name": "7b",
"description": "<p>Fitness: Share your challenges and successes in completing Second Class requirement 7a. Set a goal for continuing to include physical activity as part of your daily life and develop a plan for doing so.</p>",
"children": []
},
"36374": {
"achievement_id": 36374,
"name": "7c",
"description": "<p>Fitness: Participate in a school, community, or troop program on the dangers of using drugs, alcohol, and tobacco and other practices that could be harmful to your health. Discuss your participation in the program with your family, and explain the dangers of substance addictions. Report to your Scoutmaster or other adult leader in your troop about which parts of the Scout Oath and Scout Law relate to what you learned.</p>",
"children": []
},
"36375": {
"achievement_id": 36375,
"name": "8a",
"description": "<p>Citizenship: Participate in a flag ceremony for your school, religious institution, chartered organization, community, or Scouting activity.</p>",
"children": []
},
"36376": {
"achievement_id": 36376,
"name": "8b",
"description": "<p>Citizenship: Explain what respect is due the flag of the United States.</p>",
"children": []
},
"36377": {
"achievement_id": 36377,
"name": "8c",
"description": "<p>Citizenship: With your parents or guardian, decide on an amount of money that you would like to earn, based on the cost of a specific item you would like to purchase. Develop a written plan to earn the amount agreed upon and follow that plan; it is acceptable to make changes to your plan along the way. Discuss any changes made to your original plan and whether you met your goal.</p>",
"children": []
},
"36378": {
"achievement_id": 36378,
"name": "8d",
"description": "<p>Citizenship: At a minimum of three locations, compare the cost of the item for which you are saving to determine the best place to purchase it. After completing Second Class requirement 8c, decide if you will use the amount that you earned as originally intended, save all or part of it, or use it for another purpose.</p>",
"children": []
},
"36379": {
"achievement_id": 36379,
"name": "8e",
"description": "<p>Citizenship: Participate in two hours of service through one or more service projects approved by your Scoutmaster. Tell how your service to others relates to the Scout Oath.</p>",
"children": []
},
"36380": {
"achievement_id": 36380,
"name": "9a",
"description": "<p>Personal Safety Awareness: Explain the three R’s of personal safety and protection.</p>",
"children": []
},
"36381": {
"achievement_id": 36381,
"name": "9b",
"description": "<p>Personal Safety Awareness: Describe bullying; tell what the appropriate response is to someone who is bullying you or another person.</p>",
"children": []
},
"36382": {
"achievement_id": 36382,
"name": "10",
"description": "<p>Scout Spirit: Demonstrate Scout spirit by living the Scout Oath and Scout Law. Tell how you have done your duty to God and how you have lived four different points of the Scout Law (not to include those used for Tenderfoot requirement 9) in your everyday life.</p>",
"children": []
},
"36383": {
"achievement_id": 36383,
"name": "11",
"description": "<p>Scout Spirit: While working toward the Second Class rank, and after completing Tenderfoot requirement 10, participate in a Scoutmaster conference.</p>",
"children": []
},
"36384": {
"achievement_id": 36384,
"name": "12",
"description": "<p>Scout Spirit: Successfully complete your board of review for the Second Class rank.</p>",
"children": []
},
"scoutmaster_conference": {
"achievement_id": "scoutmaster_conference",
"name": "Scoutmaster Conference",
"description": "<p></p>",
"children": []
},
"board_of_review": {
"achievement_id": "board_of_review",
"name": "Board of Review",
"description": "<p></p>",
"children": []
}
}
}
}
}
I see. You have to get the details in a separate step for each user achievement, using this endpoint:
https://trooptrack.com/api/swagger#!/user_achievements/getV1UserAchievementsId
I hadn’t thought about the rank version problem in the API. I’ll have to consider that.
Thanks for the reply. Note that the endpoint you gave is the same one I used in my 2nd example - it doesn’t actually tell you which of the requirements a user has completed (e.g., for a partially-completed rank), it only tells you what requirements are associated with a rank (or merit badge).
Note that the endpoint you gave is the same one I used in my 2nd example - it doesn’t actually tell you which of the requirements a user has completed (e.g., for a partially-completed rank)
I’m talking about this endpoint:
GET /v1/user_achievements/{id}
But I believe you are using this endpoint:
GET /v1/achievements/{id}
The user_achievement endpoint above does exactly what you are looking for - it retrieves the detailed record of a user’s progress on an award. The endpoint you are using returns the detailed requirements of an award.
Note - award_type_id must be provided as a parameter. In the case of a rank that would be 999999998.
So, to sum up… use the user_achievements end point with a user id to get a summary of all achievements for a person, then loop through each user_achievement that is returned and call the user_achievements end point with a user_achievements ID and get all the details.
~ Dave
Ah, I see. Thanks for the clarification! With that endpoint, it looks like it requires the token for the authenticated user, so I’ll avoid using it until there is SSO generally available. Also, thanks for responding on the other thread about SSO.