Код: Выделить всё
$your_api_key = 'd4tsE7SvEgzAKlJPFrlvAz3oe9uFQnxy';
$your_api_secret = 'keepThisSecret';
$current_unix_timestamp = time();
$signature = md5($your_api_key . $your_api_secret . $current_unix_timestamp);
Код: Выделить всё
def prepare_classmarker_request(apikey, apisecret):
timestamp = str(int(time.time()))
signature = hashlib.md5(f"{apikey}{apisecret}{timestamp}".encode()).hexdigest()
return signature, timestamp
Код: Выделить всё
https://api.classmarker.com/v1.json?api_key=XXXX&signature=XXXX×tamp=XXXX
< /code>
Вот как я пытаюсь его потреблять: < /p>
@app.route('/test-auth', methods=['POST','GET'])
def test_auth():
signature, timestamp = prepare_classmarker_request(API_KEY, API_SECRET)
url = f"https://api.classmarker.com/v1.json?apikey={API_KEY}&signature={signature}×tamp={timestamp}"
response = requests.get(url)
if response.status_code == 200:
tests = response.json()
return jsonify(tests)
else:
return jsonify({
"message": "Failed to authenticate",
"status": response.status_code,
"response": response.json()
})
https://www.classmarker.com/docs/classm ... ntegration .pdf
https://www.classmarker.com/online-test ... marker-api
Что Я пытаюсь добиться? Я ищу API или услуги, которые могут помочь мне с этим, чтобы не строить все с нуля.
Подробнее здесь: https://stackoverflow.com/questions/793 ... ntegration
Мобильная версия