php sample updated to API-3