Title: Getting post-map-data via REST api
Last modified: September 1, 2016

---

# Getting post-map-data via REST api

 *  Resolved [blade86](https://wordpress.org/support/users/blade86/)
 * (@blade86)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/getting-post-map-data-via-rest-api/)
 * First of all: Thank you soo much for this great plugin!!
 * My question:
    How could I get the Map-coordination via the REST api?
 * As I understand the data are stored as meta-data on a per post base.
    At the 
   moment my json response of a post doesnt conatin any map-data 🙁
 * Any help would be awesome!!
 * Gratefully
    Blade
 * [https://wordpress.org/plugins/codepeople-post-map/](https://wordpress.org/plugins/codepeople-post-map/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/getting-post-map-data-via-rest-api/#post-7523197)
 * Hi,
 * I can give you some tips, but the final code will depend on your project.
 * Assuming that the post with ID: 123, has associated a point, you can access to
   the point’s data, calling to the WordPress function:
 * `$point_data = get_post_meta( 123, 'cpm_point', true );`
 * If you are using the free version of the plugin the result would be an associative
   array with the point’s data:
 * name
    description address latitude longitude icon thumbnail
 * if you are using the pro version of the plugin, where it is possible assign multiple
   points to a same post/page, the result of the function:
 * `$point_data = get_post_meta( 123, 'cpm_point', true );`
 * would be an array where each row is a matriz with the data corresponding to each
   point.
 * If you want to return, as result of your API, a json object, you simply should
   calling the function `json_encode` with the data of the points.
 * Best regards.
 *  Thread Starter [blade86](https://wordpress.org/support/users/blade86/)
 * (@blade86)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/getting-post-map-data-via-rest-api/#post-7523285)
 * OMG OMG OMG – Thank you sooo much !!!
 * 1st) AWESOME response time
    2nd) Perfect answer for such a nap like me 3rd) Worked
   out of the box!!!
 * “cpm_point” was the magic word 🙂
 * Cheers
    A very happy Blade <3

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Getting post-map-data via REST api’ is closed to new replies.

 * ![](https://ps.w.org/codepeople-post-map/assets/icon-256x256.jpg?rev=980165)
 * [CodePeople Post Map for Google Maps](https://wordpress.org/plugins/codepeople-post-map/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/codepeople-post-map/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/codepeople-post-map/)
 * [Active Topics](https://wordpress.org/support/plugin/codepeople-post-map/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/codepeople-post-map/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/codepeople-post-map/reviews/)

## Tags

 * [map](https://wordpress.org/support/topic-tag/map/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)

 * 2 replies
 * 2 participants
 * Last reply from: [blade86](https://wordpress.org/support/users/blade86/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/getting-post-map-data-via-rest-api/#post-7523285)
 * Status: resolved