# Search for Giving Opportunities
When people can give to causes they're most passionate about, participation increases along with workplace morale. A Giving Opportunity is a featured initiative that gets your people donating to a common goal. It's a great way to increase engagement with your giving program by bringing people together to make a greater impact.
# Search for Giving Opportunities by Topic
Search for a giving opportunity by topic by passing the topic as the value of the q
parameter after the resource /search/givingopportunities
, authenticating the request with the authorized JWT access_token
.
$ curl -X GET -H "Authorization: Bearer test_token_eyJraWQi..." \
https://api.benevity.org/search/givingopportunities?q=Clean%20Water
The search term is compared against the giving opportunity's name, description and tags. If there is a cause associated with the giving opportunity, the search term is also compared against the cause's name, description, tags and address. Newly created giving opportunities and giving opportunities happening soon will appear at the top of the list.
# Results Data
{
"giving_opportunities": [
{
"id": 178,
"title": "Clean Drinking Water",
"description": "Clean drinking water is a basic human right, let's make that possible for everyone in the world.",
"image_url": "client_data/spark.benevity-staging.org/files/userfile-63408272cd7665.15442151.jpg",
"creator_id": "65-62e9683c7170d",
"creator_name": null,
"creator_type": "company",
"peer_match": false,
"company_match": true,
"portfolio_code": "4QA2RK1Z15",
"projects": [],
"causes": [
{
"name": "CANADIAN UNICEF COMMITTEE COMITE UNICEF CANADA",
"logo_url": "https://logos.benevity.org/400x400/public/clogos/124-122680572RR0001.png",
"geo_coordinates": {
"latitude": "43.707620",
"longitude": "-79.395860"
}
}
],
"tags": null,
"product_area": null,
"office_location": null,
"snippets": {
"cause": null,
"tag": null,
"title": [
"<em>Clean</em> Drinking <em>Water</em>"
],
"body": [
"<em>Clean</em> drinking <em>water</em> is a basic human right, let's make that possible for everyone in the world."
]
}
}
]
}
# Response Attribute Clarification
id
— The associated Giving Opportunity ID in Spark
- Type: int
- Example:
123
image_url
— The Giving Opportunity image uploaded within the Giving Opportunity
- Type: string
- Append this address to the end of your Spark domain for the full image. Note: Replace [Program Domain Name] with your actual program domain name
- Example:
https://[Program Domain Name].benevity.org/client_data/[Program Domain Name].benevity.org/files/userfile-63408272cd7665.15442151.jpg
peer_match
— Determines if the Giving Opportunity was set up to allow Peer Matching
- Type: bool
- Example:
false
company_match
— Determines if the Giving Opportunity was set up with a custom donation match
- Type: bool
- Example:
true
projects
— List of projects associated to the giving opportunity
- Type: array
- Example:
[ { "name": "Water & Sanitation", "cause": { "name": "World Renew", "logo_url": "https://logos.benevity.org/400x400/public/clogos/124-118857366RR0001.jpg" }, "geo_coordinates": { "latitude": "43.370640", "longitude": "-79.797690" } } ]
causes
— List of causes associated to the giving opportunity
- Type: array
- Example:
[ { "name": "CANADIAN UNICEF COMMITTEE COMITE UNICEF CANADA", "logo_url": "https://logos.benevity.org/400x400/public/clogos/124-122680572RR0001.png", "geo_coordinates": { "latitude": "43.707620", "longitude": "-79.395860" } } ]
# Search for Giving Opportunities near you
You can further increase the relevance of your top search results by passing your location using the search_location=<latitude>,<longitude>
parameter. This will match to the causes and projects associated with the Giving Opportunity.
$ curl -X GET -H "Authorization: Bearer test_token_eyJraWQi..." \
https://api.benevity.org/search/givingopportunities?q=Dog%20Hospital&search_location=48.423466%2C-123.363258
# Search with autocorrect
You're also able to search with autocorrect enabled, by passing the autocorrect
parameter as true in your request. This helps with misspellings of words to get you the closest possible match.
$ curl -X GET -H "Authorization: Bearer test_token_eyJraWQi..." \
https://api.benevity.org/search/givingopportunities?q=Dgos&autocorrect=true
# Give to a Giving Opportunity
Once you've found a giving opportunity, you can donate by logging into and following a link to Spark.
https://<Program Name>.benevity.org/<Locale>/campaigns/donate/<Giving Opportunity Id>
For example:
https://spark.benevity.org/en-ca/campaigns/donate/178