# Create contact with SDK and REST not working

**URL:** <https://integration.keap.com/t/create-contact-with-sdk-and-rest-not-working/77734>\
**Category:** API Q&A\
**Tags:** rest-api, php-sdk, contacts\
**Created:** [June 8, 2020, 1:03pm UTC](https://integration.keap.com/t/create-contact-with-sdk-and-rest-not-working/77734 "2020-06-08T13:03:51Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Matthew\_Beeston](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Matthew\_Beeston](https://integration.keap.com/u/Matthew_Beeston)\
**Post date:** [June 15, 2020, 10:35am UTC](https://integration.keap.com/t/create-contact-with-sdk-and-rest-not-working/77734/4 "2020-06-15T10:35:53Z")

</div>

I found an answer after rereading @Andrew_Johnson’s post and finding this post in the forums:

> [@Error When Trying To Create Contact with PHP SDK](https://integration.keap.com/t/error-when-trying-to-create-contact-with-php-sdk/10771/2):
>
> Hi @Jer_Fortenberry, I’m not extremely familiar with PHP but I think I may know your issue. The email\_addresses and phone\_numbers properties take an array of objects, each representing a different field or set of fields. I think you need to wrap your objects in one more array() like this. $contact = array( 'email\_addresses' =\> array( array( 'email' =\> 'test@test.com', 'field' =\> 'EMAIL1' ) ), 'given\_name' =\> 'John', 'family\_name' =\> 'Doe', 'phone\_numbers' =\> array( array( 'f…

In my case the email\_addresses field needed to be a multidimensional array. I corrected my code to produce the following output:

```auto
{
	"email_addresses": {
		"0": {
			"email": "name@email.com",
			"field": "EMAIL1"
		}
	}
}

```

It would be extremely helpful if somewhere between the SDK and the API could give more detailed feedback as to which element of the input is invalid.

---

_[View the full topic](https://integration.keap.com/t/create-contact-with-sdk-and-rest-not-working/77734)._
