# GF update affects REST API

**URL:** <https://community.gravityforms.com/t/gf-update-affects-rest-api/6629>\
**Category:** General Discussion\
**Tags:** gfapi\
**Created:** [October 26, 2020, 4:26pm UTC](https://community.gravityforms.com/t/gf-update-affects-rest-api/6629 "2020-10-26T16:26:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5b13b577995466.6](https://avatars.discourse-cdn.com/v4/letter/u/c77e96/32.png) [@user5b13b577995466.6](https://community.gravityforms.com/u/user5b13b577995466.6)\
**Post date:** [October 26, 2020, 4:26pm UTC](https://community.gravityforms.com/t/gf-update-affects-rest-api/6629/1 "2020-10-26T16:26:41Z")

</div>

The latest GF update broke my REST API script. The change (as far as i could work out) is something to do with the format / titles of the JSON response. I had to change how i refer to values within the response to get it working again.

---

<div class="post-metadata">

**Author:** ![user5b13b577995466.6](https://avatars.discourse-cdn.com/v4/letter/u/c77e96/32.png) [@user5b13b577995466.6](https://community.gravityforms.com/u/user5b13b577995466.6)\
**Post date:** [October 26, 2020, 4:50pm UTC](https://community.gravityforms.com/t/gf-update-affects-rest-api/6629/2 "2020-10-26T16:50:09Z")

</div>

Using this endpoint to pick a specific entry $\_GET[‘gfid’] from a specific form 17:

`https://newcastleproms.org.uk/wp-json/gf/v2/entries?form_ids[0]=17&include[0]=".$_GET['gfid']);`

I had to change this:

```
$body = json_decode($output);

function objectToArray( $object ){
   if( !is_object( $object ) && !is_array( $object ) ){
    return $object;
 }
if( is_object( $object ) ){
    $object = get_object_vars( $object );
}
    return array_map( 'objectToArray', $object );
}

$array = objectToArray( $body );

foreach($array['entries'] as $item) {
 
    $date = $item['16']; 
  }

```

to this:

```
$body = json_decode($output);

function objectToArray( $object ){
   if( !is_object( $object ) && !is_array( $object ) ){
    return $object;
 }
if( is_object( $object ) ){
    $object = get_object_vars( $object );
}
    return array_map( 'objectToArray', $object );
}

$array = objectToArray( $body );

$mobile = $array[$_GET['gfid']]['13'];
```

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [October 26, 2020, 5:25pm UTC](https://community.gravityforms.com/t/gf-update-affects-rest-api/6629/3 "2020-10-26T17:25:08Z")

</div>

Hello Adnaan. I recommend reporting this issue to Gravity Forms support:

> **[Support | Gravity Forms](https://www.gravityforms.com/support/)**
>
> We are always here to help. If you have any issues/questions about our plugin, please create a ticket here to get immediate support from our team.

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 12:40pm UTC](https://community.gravityforms.com/t/gf-update-affects-rest-api/6629/4 "2022-01-05T12:40:38Z")

</div>


