Encode docId when doing REST call