Curl commands for API

# Using curl in your terminal
curl -u spark:spark \
     -d grant_type=password -d -d password=SuperSecret

I write very little English, excuse me.
I want to know to find the grant_type=password
I wrote a dll in C #, for Windows 7
thank you

Can you explain what do you need?

The password is your account password basically

I would like to find grant_type password
I do not know whether a Requet, get or post?
and protocol and host

@DavDesloges, you might want to read the docs closely:

It says:

In the **POST** body, you need three parameters:

I look at the Doc, but I do not know what to make grant_type = password.

That’s a parameter that you are passing along so it’s simply grant_type = password.

Maybe someone else more familiar/experienced can help you in this area instead :wink:

thank you

:grinning: Perceverance, I found the solution for those interested, here it is in C #
must access a Post and Get

    Access Bearer:
    WebRequest req = WebRequest.Create(new Uri(""));
    req.Method = "POST";
    req.ContentType = "application/json";
    byte[] sentData = Encoding.UTF8.GetBytes("{\"username\":\"" + MyEmail + "\",\"password\":\"" + MyPassWord + "\"}";);
    req.ContentLength = sentData.Length;
    using (Stream sendStream = req.GetRequestStream())
     sendStream.Write(sentData, 0, sentData.Length);
    WebResponse res = req.GetResponse();
    Stream ReceiveStream = res.GetResponseStream();
    using (StreamReader sr = new StreamReader(ReceiveStream, Encoding.UTF8))
     String ResultJson = sr.ReadToEnd();

“username": “XXXXXX@XXXXXXX.XX”, // MyEmail
"is_elite": false,
“token”: “9sXXXXXXXXXXXXXXXXX”, // <= Bearer Token
"expires_at": “2015-08-10T17:21:14Z”

    Access Tokens:

WebRequest http = HttpWebRequest.Create(new Uri(""));
http.Method = "GET";
http.ContentType = application/json;
var Header = new WebHeaderCollection();
Header.Add("Authorization", "Bearer " + "9sXXXXXXXXXXXXXXXXX");    // <= My Bearer Token
http.Headers = Header;
HttpWebResponse response = (HttpWebResponse)http.GetResponse();
Stream StreamResponse = response.GetResponseStream();
using (StreamReader reader = new StreamReader(StreamResponse, Encoding.UTF8))
String ResultJson2 = reader.ReadToEnd();

ResultJson2 :
“access_token”: “2axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”, // <= My Access_Token
"access_token_expires_at": “2015-06-T08:30:11+00:00”,
“spark_api_token”: “fbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”

1 Like