I am using Google SDK V1beta
found HERE
I have successfully created an account, and created a property under that account after much trouble with the documentation not aligning with the API/SDK.
I am now trying to create a DataStream, and I am almost there. The Example the the SDK uses can be found HERE -- However this example, like most provided in the docs is broken. If you use the example provided you'll find that the ->createDataStream(
requires more aruments than just one .. Even when using V1beta library. So I came up with this:
$dataStream = (new DataStream())
->setDisplayName('Zaks Datastream')
->setType('1');
try {
/** @var DataStream $response */
$response = $client->createDataStream($property_name, $dataStream);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
It passes the SDK checks but the call returns:
Call failed with message: {
"message": "The value for the 'default_uri' field was empty, but must be provided.",
"code": 3,
"status": "INVALID_ARGUMENT",
"details": []
}
When I look for setting the default URI there is no option in the SDK to do so .. -->
Google's documentation is frustrating to say the least .. Is there an external function, or another call to set the default URI?