cloudconvert / cloudconvert-java

Official CloudConvert Java SDK
35 stars 19 forks source link

Getting null as a response while trying to create a Job #43

Closed roshan1894 closed 2 years ago

roshan1894 commented 2 years ago

I am just trying to create a job which consists of only one task that imports a file from a public url. But i am getting null as a job response.

API key and Webhook signing secret is correct and I am using live environment instead of sandbox.

While creating webhook from dashboard, i was confused about url - as the documentation says "The URL to send the notifications to" so i am putting my web application url. I don't know if it is causing the issue.

While using JobBuilder, it is working fine.

Here is the code i am using:

CloudConvertClient cloudConvertClient = new CloudConvertClient(new StringSettingsProvider("api-key", "webhook-signing-secret", false)); JobResponse createJobResponse = cloudConvertClient.jobs() .create(ImmutableMap.of( "import-my-file", new UrlImportRequest().setUrl("https://file-examples-com.github.io/uploads/2017/02/file-sample_1MB.doc") .setFilename("file-sample_1MB.doc") )) .getBody();

roshan1894 commented 2 years ago

Sorry, my bad. I was giving API_KEY name instead of API_KEY access token in authorization header. Working fine now so I am closing this issue.