This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:create:functions:readapi [26.11.2014 16:25] – [readAPI()] alexander.ritter | en:create:functions:readapi [19.04.2023 22:20] (current) – gelöscht admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== readAPI() ====== | ||
- | '' | ||
- | |||
- | APIs (standardized interfaces, Application Programming Interface) allow third-party services to be incorporated into the developer' | ||
- | |||
- | * //API ID//\\ The ID of the service to be used. Currently, SoSci Survey supports the following APIs: | ||
- | * // | ||
- | * // | ||
- | * **Note:** Further APIs can be added within more specific research projects -- please send all requests directly to [[info@soscisurvey.de|SoSci Survey]]. | ||
- | * // | ||
- | * //API Key//\\ If the use of the API requires a key to be specifed, this is entered as the third parameter. Normally a key is used to calculate the bill for API services. | ||
- | |||
- | The function translates the answer of the API directly into an array, which can be set up relatively easily in PHP. Use the function '' | ||
- | |||
- | ===== Example ===== | ||
- | |||
- | <code php> | ||
- | // request to Google Maps (search for a street using coordinates) | ||
- | $v = readAPI(' | ||
- | debug($v); | ||
- | // output of street found | ||
- | html('< | ||
- | </ | ||
- | |||
- | <code php> | ||
- | // request to Cloudmade | ||
- | $v = readAPI(' | ||
- | debug($v); | ||
- | </ |