Using addObject to add records to first index. Getting exception thrown 'body must contain an object near line: 1 column:171789". Using PHP API addObject method.
From debugger, copied json that was sent to addObject, and created file. Then, uploaded that file via the Dashboard. Loaded fine.
Looking for guidance on what’s going wrong with API call to upload records.
$this->client = SearchClient::create( $this->appId, $this->apiKey ); $index = $this->client->initIndex('Events'); $records = $this->buildIndexEvent($memberEvent, $event); $jsonRecords = json_encode($records); $index->saveObject($jsonRecords, ['autoGenerateObjectIDIfNotExist' => true]);