encode json sample