PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → CURL API Request
CURL API Request
Iniciado por Ruan, 07,oct. 2014 15:09 - 7 respuestas
Miembro registrado
214 mensajes
Publicado el 07,octubre 2014 - 15:09
Good Day

I have worked with Api's on windev before but I am really struggling with this one. I nee to use a curl request and I have no idea how. Here is example of the request:

# Request
curl -u <api_key>: https://app.asana.com/api/1.0/users/me

I tried to use the HTTPRequest but cannot get it to work.

What am I doing wrong?

Thanks
Publicado el 07,octubre 2014 - 16:55
Hi Ruan

On 10/7/2014 7:09 AM, Ruan wrote:
Good Day

I have worked with Api's on windev before but I am really struggling
with this one. I nee to use a curl request and I have no idea how. Here
is example of the request:

# Request
curl -u <api_key>: https://app.asana.com/api/1.0/users/me

I tried to use the HTTPRequest but cannot get it to work.

What am I doing wrong?


Without seeing your code AND without having the documentation of the API
(get, post, security, etc), that is going to be difficult to say

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXReplication, your open source replication system is available on
my web site!!!
WXShowroom.com: Show your projects!
More information on http://www.fabriceharari.com

> Thanks
Miembro registrado
214 mensajes
Publicado el 07,octubre 2014 - 17:31
Fabrice Harari wrote:
Hi Ruan

On 10/7/2014 7:09 AM, Ruan wrote:
Good Day

I have worked with Api's on windev before but I am really struggling
with this one. I nee to use a curl request and I have no idea how. Here
is example of the request:

# Request
curl -u <api_key>: https://app.asana.com/api/1.0/users/me

I tried to use the HTTPRequest but cannot get it to work.

What am I doing wrong?


Without seeing your code AND without having the documentation of the API
(get, post, security, etc), that is going to be difficult to say

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXReplication, your open source replication system is available on
my web site!!!
WXShowroom.com: Show your projects!
More information on http://www.fabriceharari.com

Thanks


Hi

Here is example of my code:

sBeforefront is string

sBeforefront = HTTPRequest("curl -u <api_key>: https://app.asana.com/api/1.0/users/5678")
HTTPGetResult(httpResult)
EDT_Text1 = HTTPGetResult(httpResult)


This didn't bring back anything: This is what they have to say about this: http://developer.asana.com/documentation/…

Thanks
Publicado el 07,octubre 2014 - 17:45
Hi Ruan

curl -u <api_key>: is the equivalent of httprequest in another language
(php?)

So your code should be something like
httprequest("https://app.asana.com/api/1.0/users/me")

Best regards


--
Fabrice Harari
Consultant WinDev, WebDev et WinDev Mobile International

NOUVEAU: WXReplication, votre système de réplication open source est
disponible sur mon site web !!!
WXShowroom.com : Montrez vos projets !
Plus d'information sur http://fabriceharari.com


On 10/7/2014 9:31 AM, Ruan wrote:
Fabrice Harari wrote:
Hi Ruan

On 10/7/2014 7:09 AM, Ruan wrote:
Good Day

I have worked with Api's on windev before but I am really struggling
with this one. I nee to use a curl request and I have no idea how. Here
is example of the request:

# Request
curl -u <api_key>: https://app.asana.com/api/1.0/users/me

I tried to use the HTTPRequest but cannot get it to work.

What am I doing wrong?


Without seeing your code AND without having the documentation of the API
(get, post, security, etc), that is going to be difficult to say

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXReplication, your open source replication system is available on
my web site!!!
WXShowroom.com: Show your projects!
More information on http://www.fabriceharari.com

Thanks

Hi

Here is example of my code:

sBeforefront is string

sBeforefront = HTTPRequest("curl -u <api_key>:
https://app.asana.com/api/1.0/users/5678")
HTTPGetResult(httpResult)
EDT_Text1 = HTTPGetResult(httpResult)


This didn't bring back anything: This is what they have to say about
this: http://developer.asana.com/documentation/…

Thanks
Publicado el 07,octubre 2014 - 18:07
Hi Ruan,

You're getting close. The curl -u is corresponding is asking you to to provide a Username. So the equivalent in windev will be something like:

HTTPRequest("ttps://app.asana.com/api/1.0/users/me","","","","","<API_KEY>","<PASSWORD_IF_ANY>")


That should provide the same functionality as the curl call you posted.

Cheers!
Ken
Miembro registrado
214 mensajes
Publicado el 07,octubre 2014 - 18:07
Fabrice Harari wrote:
Hi Ruan

curl -u <api_key>: is the equivalent of httprequest in another language
(php?)

So your code should be something like
httprequest("https://app.asana.com/api/1.0/users/me")

Best regards


--
Fabrice Harari
Consultant WinDev, WebDev et WinDev Mobile International

NOUVEAU: WXReplication, votre système de réplication open source est
disponible sur mon site web !!!
WXShowroom.com : Montrez vos projets !
Plus d'information sur http://fabriceharari.com


On 10/7/2014 9:31 AM, Ruan wrote:
Fabrice Harari wrote:
Hi Ruan

On 10/7/2014 7:09 AM, Ruan wrote:
Good Day

I have worked with Api's on windev before but I am really struggling
with this one. I nee to use a curl request and I have no idea how. Here
is example of the request:

# Request
curl -u <api_key>: https://app.asana.com/api/1.0/users/me

I tried to use the HTTPRequest but cannot get it to work.

What am I doing wrong?


Without seeing your code AND without having the documentation of the API
(get, post, security, etc), that is going to be difficult to say

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXReplication, your open source replication system is available on
my web site!!!
WXShowroom.com: Show your projects!
More information on http://www.fabriceharari.com

Thanks

Hi

Here is example of my code:

sBeforefront is string

sBeforefront = HTTPRequest("curl -u <api_key>:
https://app.asana.com/api/1.0/users/5678")
HTTPGetResult(httpResult)
EDT_Text1 = HTTPGetResult(httpResult)


This didn't bring back anything: This is what they have to say about
this: http://developer.asana.com/documentation/…

Thanks


I tested it like that and I do get response back. Looks like I need to add the api_key somewhere

Thanks
Miembro registrado
214 mensajes
Publicado el 09,octubre 2014 - 13:30
Ken Knight wrote:
Hi Ruan,

You're getting close. The curl -u is corresponding is asking you to to provide a Username. So the equivalent in windev will be something like:

HTTPRequest("ttps://app.asana.com/api/1.0/users/me","","","","","<API_KEY>","<PASSWORD_IF_ANY>")


That should provide the same functionality as the curl call you posted.

Cheers!
Ken


Hi Ken

Thanks for the response. I tried that out with the API KEY and with my Password, Then with my USERNAME and PASSWORD but still it returns:

{"errors":[{"message":"Not Authorized"}]}

am I doing the whole code correct?

myrequest is string
sMyresult is string


myrequest = HTTPRequest("https://app.asana.com/api/1.0/users/me","","","","","API KEY","PASSWORD")

sMyresult = HTTPGetResult(httpResult)
EDT_RESULT = sMyresult


Thanks
Miembro registrado
214 mensajes
Publicado el 23,octubre 2014 - 11:17
Ruan wrote:
Ken Knight wrote:
Hi Ruan,

You're getting close. The curl -u is corresponding is asking you to to provide a Username. So the equivalent in windev will be something like:

HTTPRequest("ttps://app.asana.com/api/1.0/users/me","","","","","<API_KEY>","<PASSWORD_IF_ANY>")


That should provide the same functionality as the curl call you posted.

Cheers!
Ken


Hi Ken

Thanks for the response. I tried that out with the API KEY and with my Password, Then with my USERNAME and PASSWORD but still it returns:

{"errors":[{"message":"Not Authorized"}]}

am I doing the whole code correct?

myrequest is string
sMyresult is string


myrequest = HTTPRequest("https://app.asana.com/api/1.0/users/me","","","","","API KEY","PASSWORD")

sMyresult = HTTPGetResult(httpResult)
EDT_RESULT = sMyresult


Thanks


Hi Ken

I managed to get this right. Thanks a lot for your help.

myrequest = HTTPRequest("https://app.asana.com/api/1.0/users/me","","","","","API KEY","") I sould just not add password...

Working

Thanks