Use from the game
s&box passes 4xx response bodies through to game code, so a rejected call returns no value and the library reports the server's error code. The Logs tab shows the status.
This project has no enabled public key. Create one under API keys: game code needs it.
var result = await NetworkStorage.CallEndpoint( "inventory_get" );
if ( !result.HasValue )
{
NetworkStorage.TryGetLastEndpointError( "inventory_get", out var code, out var message );
Log.Warning( $"inventory_get failed: {code} {message}" );
return;
}My sbox-ns project ID is proj_a75070d69b083f0f16f827f1. I am working on the endpoint "inventory_get". Read its definition with definition_get, then dry-run it with endpoint_test for a success case and a rejected case (target next when staged). Check logs_requests and errors_recent for failures, and show me the C# that calls it with NetworkStorage.CallEndpoint. Do not save anything without my confirm string.