Skip to main content
replaced http://stackapps.com/ with https://stackapps.com/
Source Link

You cannot use a standard GET request.You cannot use a standard GET request. You must obtain the access_token and then POST the necessary parameters.

The steps are currently:

Setup:

  1. Register your app.Register your app.
  2. Link it with a post here on Stack Apps that has a legitimate [app] or [script] taga post here on Stack Apps that has a legitimate [app] or [script] tag. In most cases you will also tag it with .

In your app:

  1. Have the user authorize your app and obtain an access_token by following the instructions in the Authentication doc page. Be sure to include write_access in the requested scope.

Note that there are two different auth recipes: explicit and implicit.
Which one you are allowed to use is controlled by the Client Side Flow setting on your app's registration page (visible only to you)your app's registration page (visible only to you).

If Client Side Flow is Enabled use the "implicit" recipe.
Otherwise, use the "explicit" steps.

For faster and easier code, use a librarya library or use the JavaScript SDK to handle authentication.

  1. Send a POST to

    https://api.stackexchange.com/2.2/questions/{id}/favorite
    

with the following parameters at a minimum:

id = {The question id -- same as in the POST URL}
key = {Your app's key}
site = stackoverflow //-- Or whatever site you're operating on
preview = false
access_token = {The access token you obtained in step 1}

  1. On success, the API will return JSON with a question object. EG:

    {
      "items": [
      ... {question details} ...
      ],
      "has_more": false,
      "quota_max": 10000,
      "quota_remaining": 9996
    }
    

You cannot use a standard GET request. You must obtain the access_token and then POST the necessary parameters.

The steps are currently:

Setup:

  1. Register your app.
  2. Link it with a post here on Stack Apps that has a legitimate [app] or [script] tag. In most cases you will also tag it with .

In your app:

  1. Have the user authorize your app and obtain an access_token by following the instructions in the Authentication doc page. Be sure to include write_access in the requested scope.

Note that there are two different auth recipes: explicit and implicit.
Which one you are allowed to use is controlled by the Client Side Flow setting on your app's registration page (visible only to you).

If Client Side Flow is Enabled use the "implicit" recipe.
Otherwise, use the "explicit" steps.

For faster and easier code, use a library or use the JavaScript SDK to handle authentication.

  1. Send a POST to

    https://api.stackexchange.com/2.2/questions/{id}/favorite
    

with the following parameters at a minimum:

id = {The question id -- same as in the POST URL}
key = {Your app's key}
site = stackoverflow //-- Or whatever site you're operating on
preview = false
access_token = {The access token you obtained in step 1}

  1. On success, the API will return JSON with a question object. EG:

    {
      "items": [
      ... {question details} ...
      ],
      "has_more": false,
      "quota_max": 10000,
      "quota_remaining": 9996
    }
    

You cannot use a standard GET request. You must obtain the access_token and then POST the necessary parameters.

The steps are currently:

Setup:

  1. Register your app.
  2. Link it with a post here on Stack Apps that has a legitimate [app] or [script] tag. In most cases you will also tag it with .

In your app:

  1. Have the user authorize your app and obtain an access_token by following the instructions in the Authentication doc page. Be sure to include write_access in the requested scope.

Note that there are two different auth recipes: explicit and implicit.
Which one you are allowed to use is controlled by the Client Side Flow setting on your app's registration page (visible only to you).

If Client Side Flow is Enabled use the "implicit" recipe.
Otherwise, use the "explicit" steps.

For faster and easier code, use a library or use the JavaScript SDK to handle authentication.

  1. Send a POST to

    https://api.stackexchange.com/2.2/questions/{id}/favorite
    

with the following parameters at a minimum:

id = {The question id -- same as in the POST URL}
key = {Your app's key}
site = stackoverflow //-- Or whatever site you're operating on
preview = false
access_token = {The access token you obtained in step 1}

  1. On success, the API will return JSON with a question object. EG:

    {
      "items": [
      ... {question details} ...
      ],
      "has_more": false,
      "quota_max": 10000,
      "quota_remaining": 9996
    }
    
Source Link
Brock Adams
  • 13k
  • 5
  • 39
  • 64

You cannot use a standard GET request. You must obtain the access_token and then POST the necessary parameters.

The steps are currently:

Setup:

  1. Register your app.
  2. Link it with a post here on Stack Apps that has a legitimate [app] or [script] tag. In most cases you will also tag it with .

In your app:

  1. Have the user authorize your app and obtain an access_token by following the instructions in the Authentication doc page. Be sure to include write_access in the requested scope.

Note that there are two different auth recipes: explicit and implicit.
Which one you are allowed to use is controlled by the Client Side Flow setting on your app's registration page (visible only to you).

If Client Side Flow is Enabled use the "implicit" recipe.
Otherwise, use the "explicit" steps.

For faster and easier code, use a library or use the JavaScript SDK to handle authentication.

  1. Send a POST to

    https://api.stackexchange.com/2.2/questions/{id}/favorite
    

with the following parameters at a minimum:

id = {The question id -- same as in the POST URL}
key = {Your app's key}
site = stackoverflow //-- Or whatever site you're operating on
preview = false
access_token = {The access token you obtained in step 1}

  1. On success, the API will return JSON with a question object. EG:

    {
      "items": [
      ... {question details} ...
      ],
      "has_more": false,
      "quota_max": 10000,
      "quota_remaining": 9996
    }