Skip to main content
edited tags
Link
edited tags
Link
Catija
  • 290
  • 1
  • 9
deleted 4 characters in body
Source Link
Glorfindel
  • 6.9k
  • 3
  • 22
  • 49

Hey i'mI'm trying to post an article using StackExchange's Teams apiAPI then try to pull that new article's id from the apiAPI response. The article gets posted but the items field is empty :

{"items":[], "has_more":false,"quota_max":10000,"quota_remaining":9999"}

thisThis is weird because the docs state that the request is supposed to return an article block https://api.stackexchange.com/docs/create-article

whatWhat am iI doing wrong? here'sHere's my code (in Python):

import requests
base_url = "https://api.stackexchange.com/"
payload = {'title' : title, 'body' : body, 'article_type' : article_type, 'tags' : tags, 'key' : key, 'site' : 'stackoverflow', 'team' : team}
r = requests.post(base_url + "2.3/articles/add", headers = {"X-API-Access-Token" : access_token}, data = payload)
print(r.text)

Note that i'veI've hidden only the variables iI pass to the payload dictionary. butBut those variables are correct because as iI said, the article gets posted successfully. iI tried adding {"filter" : "default"} to the payload but iI get the same response.

Hey i'm trying to post an article using StackExchange's Teams api then try to pull that new article's id from the api response. The article gets posted but the items field is empty :

{"items":[], "has_more":false,"quota_max":10000,"quota_remaining":9999"}

this is weird because the docs state that the request is supposed to return an article block https://api.stackexchange.com/docs/create-article

what am i doing wrong? here's my code (in Python):

import requests
base_url = "https://api.stackexchange.com/"
payload = {'title' : title, 'body' : body, 'article_type' : article_type, 'tags' : tags, 'key' : key, 'site' : 'stackoverflow', 'team' : team}
r = requests.post(base_url + "2.3/articles/add", headers = {"X-API-Access-Token" : access_token}, data = payload)
print(r.text)

Note that i've hidden only the variables i pass to the payload dictionary. but those variables are correct because as i said, the article gets posted successfully. i tried adding {"filter" : "default"} to the payload but i get the same response.

I'm trying to post an article using StackExchange's Teams API then try to pull that new article's id from the API response. The article gets posted but the items field is empty :

{"items":[], "has_more":false,"quota_max":10000,"quota_remaining":9999"}

This is weird because the docs state that the request is supposed to return an article block https://api.stackexchange.com/docs/create-article

What am I doing wrong? Here's my code (in Python):

import requests
base_url = "https://api.stackexchange.com/"
payload = {'title' : title, 'body' : body, 'article_type' : article_type, 'tags' : tags, 'key' : key, 'site' : 'stackoverflow', 'team' : team}
r = requests.post(base_url + "2.3/articles/add", headers = {"X-API-Access-Token" : access_token}, data = payload)
print(r.text)

Note that I've hidden only the variables I pass to the payload dictionary. But those variables are correct because as I said, the article gets posted successfully. I tried adding {"filter" : "default"} to the payload but I get the same response.

Source Link
Loading