I'm trying to insert a JSON document into DocumentDB via REST, using PHP (which lacks an official API wrapper). Now, it seems that a partition key has become mandatory for any collection in DocumentDB, but i cannot find the REST API documented.
I get the following error in return:
PartitionKey extracted from document doesn't match the one specified in the header
The JSON document I'm trying to insert looks as follows:
{ id:"1", ... "domain":"domain.com" }
In Azure, I have defined the collection with the following partition key:
/domain
And when sending the REST request, I send along the following header:
x-ms-documentdb-partitionkey: [ "domain" ]
What am I missing here?
x-ms-documentdb-partitionkey: [ "domain.com" ]
. Please try with this. – Gaurav Mantri