You are very close ... just the way you are passing parameters is wrong. Each request parameter should be passed individually with the -d flag AND the parameter values need to be URL-encoded. Try this and see if it works right for you:
curl -u admin:ourpass -k https://ourserver.com:8089/services/search/jobs -d search="search index%3Dassets_index gid%3D30 | timechart count(clientip) AS Impressions dc(clientip) AS Uniques
"
Not sure what language is your webapp in, Splunk also has SDKs in multiple languages. It might be easier to go through the SDKs and let them handle talking to Splunk.