0

Almost an identical match against the documentation example at the bottom of this page: https://api.copyleaks.com/documentation/v3/scans/submit/url#sandbox-mode

import requests
import json

headers = {
    'Content-type': 'application/json',
    'Authorization': 'Bearer [KEY]'
}

myobj = {'url':'[TARGET_URL]','properties':{'action':0,'includeHtml':False,'developerPayload':'Custom developer payload','sandbox':False,'expiration':480,'author':{'id':'Author id'},'webhooks':{'newResult':'https://[URL]/copyleaks_callback','status':'https://[URL]/copyleaks_callback'},'filters':{'identicalEnabled':True,'minorChangesEnabled':True,'relatedMeaningEnabled':True,'minCopiedWords':10,'safeSearch':False,'domains':['www.rd.com'],'domainsMode':1},'scanning':{'internet':True},'exclude':{'quotes':False,'titles':False,'htmlTemplate':False},'sensitivityLevel':3}}

response = requests.put('https://api.copyleaks.com/v3/scans/submit/url/[ID]', headers=headers, json=myobj)

Doesn't work as advertised. I asked via Copyleaks support, over email, via github, and even by DMing one of the engineers on linkedin but nobody can answer this. I don't think I'm missing anything here... right?

DGaff
  • 471
  • 1
  • 3
  • 8

1 Answers1

0

Did you replaced the [Key] with a valid authentication token?

I guess that you answer is "yes", so please run this cURL command with your existing key:

curl -XGET -H "Authorization: Bearer YOUR-LOGIN-TOKEN" 'https://api.copyleaks.com/v3/scans/credits'

Does it working for you? If no, the problem is probably with your authentication token.

No1Lives4Ever
  • 6,430
  • 19
  • 77
  • 140
  • 1
    That works! The issue was ultimately something I was missing (as always, its always the thing you're missing)! The trick is that the API keys provided are not to be used straight - you need to use them to login, and *then* pass them as tokens into the Auth header. Makes sense, but less straightforward. – DGaff Mar 28 '23 at 11:52