최근 검색


최근 검색 없음

Kevin Lamenzo's Avatar

Kevin Lamenzo

가입한 날짜: 2021년 4월 16일

·

마지막 활동: 2022년 2월 04일

팔로잉

0

팔로워

0

총 활동 수

9

투표 수

0

플랜 수

6

활동 개요

님의 최근 활동 Kevin Lamenzo

Kevin Lamenzo님이 에 댓글을 입력함

커뮤니티 댓글 Developer - Zendesk APIs

Could use some help translating a Help Center create attachment request from CURL into Python. Speficially, the -F tags in the CURL statement are throwing me off. I also tried GETing and attachment, then recreating the JSON object returned as my payload for the post, but I'm getting back a 500 error.

I took my subdomain, usr/pass out of the snippets below.

CURL:

curl -u  https://..zendesk.com/api/v2/help_center/articles/115005591108/attachments.json -F "inline=true" -F "file=@635564" -v -X POST

Python (I copied the example above to create a ticket and tweaked it for posting an article attachment in HC):

import requests

# Package the data in a dictionary matching the expected JSON
data = {"article_id": 115005591108, "display_file_name": "635564", "file_name": "635564", "inline": 'true'}
data2 = {"article_id": 115005591108}

# Encode the data to create a JSON payload
payload = json.dumps(data)

# Set the request parameters
url = 'https://.zendesk.com/api/v2/help_center/articles/attachments'
user =
pwd =
headers = {'content-type': 'application/json'}

# Do the HTTP post request
response = requests.post(url, data=payload, auth=(user, pwd), headers=headers)

# Check for HTTP codes other than 201 (Created)
if response.status_code != 201:
    print('Status:', response.status_code, 'Problem with the request. Exiting.')
    exit()

# Report success
print('Successfully created the ticket.')

 

댓글 보기 · 2021년 3월 17일에 게시됨 · Kevin Lamenzo

0

팔로워

0

투표 수

0

댓글


Kevin Lamenzo님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

+1. We're trying to accomplish the same thing. Is there a settings file that can be exposed in the theme editor?

댓글 보기 · 2018년 11월 14일에 게시됨 · Kevin Lamenzo

0

팔로워

0

투표 수

0

댓글


Kevin Lamenzo님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

We just had this problem. I haven't tested every social platform, but we solved it on Slack by uploading our existing logo as a separate asset, then swapping out the reference within the header template file. Then I updated a darker version of our logo to the actual logo field in the theme settings. This image in the logo field is what is referenced when sharing articles on Slack, but our template pages are pulling in the same white version of our logo we were using before.

댓글 보기 · 2018년 3월 19일에 게시됨 · Kevin Lamenzo

0

팔로워

0

투표 수

0

댓글