Hi Ganesh,

Thanks for the quick reply! I changed my API call to: curl 
http://localhost:8153/go/api/pipelines/MyFirst/schedule -u 'admin:abc' -H 
'Confirm:true' -X POST

However, now I get a 401 unauthorized response.

What I tried myself:
- If I remove the quotes around the username:password in the curl command I 
get a 404 not found instead.
- Logging out and into the portal with the user. I am sure that the 
username & password are correct since it's the only user that there is 
(htpasswd file), and it's an enabled admin user. 
- Tried to look for a configuration section where I could authorize users 
to use the API. Didn't find anything.

Do you know what might be going on?


Kind regards,
Oskar

On Sunday, August 13, 2017 at 8:37:33 AM UTC+2, Ganesh Patil wrote:
>
> Hey Oskar
> *,*
> You need to specify request command to be POST and a  'Confirm: true' 
> header. 
> Also, there is no need of 'Accept:application/vnd.go.cd.v5+json' api 
> header and '-d "" ' option.
>
> As per the documentation, the API request should be:
>
> curl 'http://localhost:8153/go/api/pipelines/MyFirst/schedule' \
>        -u 'admin:abc' \
>        -H 'Confirm: true' \
>        -X POST
>
> Cheers,
> Ganesh
>
>
> On Sun, Aug 13, 2017 at 11:38 AM, Oskar uit de Bos <oska...@gmail.com 
> <javascript:>> wrote:
>
>> Hi everyone,
>>
>> I am new to the go.cd platform and I am experimenting with the API. I am 
>> trying to trigger a pipeline, and after looking at the documentation (
>> https://api.gocd.org/17.8.0/#scheduling-pipelines 
>> <https://www.google.com/url?q=https%3A%2F%2Fapi.gocd.org%2F17.8.0%2F%23scheduling-pipelines&sa=D&sntz=1&usg=AFQjCNH6cRdkrcYwUyHhBBsyjoajHSJ1qw>)
>>  
>> it looked fairly easy to do that. However, all I am getting back is "The 
>> URL you are trying to reach appears to be incorrect.". 
>>
>> My API call looks like this: curl -u admin:abc --header 
>> "Accept:application/vnd.go.cd.v5+json" -d "" 
>> http://localhost:8153/go/api/pipelines/MyFirst/schedule
>>
>> I am able to get the pipeline status from the API with the following 
>> call: curl -u admin:abc --header "Accept:application/vnd.go.cd.v5+json" 
>> -d "" -Xget http://localhost:8153/go/api/pipelines/MyFirst/status
>> The output is 
>> : 
>> {"pausedCause":"","pausedBy":"","paused":false,"schedulable":true,"locked":false}
>>
>> Anyone able to help me out with what is causing the issue? Thanks in 
>> advance.
>>
>> Kind regards,
>> Oskar
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "go-cd" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to go-cd+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to