cURL Example

cURLexternal link is a command line tool for transferring files with URL syntax and can be download hereexternal link. It can be used in conjunction with other programming languages, like PHP, or run by itself using the command line. All of the documented API operations contain an example of how to access the operation using cURL.

The example below sets the Accept header to application/xml, therefore, the response is returned in the XML format.

Sample Request

The following code calls the Get All Projects Ids API operation that retrieves all the available project ids.

                  curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "https://api.globalgiving.org/api/public/projectservice/all/projects/ids?api_key=YOUR_API_KEY"
               

Sample Response

                  <projects>   
                     <project>         
                        <id>3</id>     
                     </project>     
                     <project>
                        <id>18</id>
                     </project>     
                     <project>         
                        <id>4</id>     
                     </project>     
                     <project>         
                        <id>6</id>     
                     </project>         
                     <project>......</project> 
                  
                  </projects>