Skip to content

Instantly share code, notes, and snippets.

@litalhassine
Created January 18, 2019 09:56
Show Gist options
  • Save litalhassine/22167a1f390b15a8d77d75de1fd59abc to your computer and use it in GitHub Desktop.
Save litalhassine/22167a1f390b15a8d77d75de1fd59abc to your computer and use it in GitHub Desktop.
import requests
import json
import datetime
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
params = {
"api_token": "TAKE ME FROM APPSFLYER"
}
import uuid
body = {
"subject_request_id": str(uuid.uuid4()),
"subject_request_type": "erasure",
"submitted_time": datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ"),
"subject_identities": [
{ "identity_type": "ios_advertising_id",
"identity_value": "APPSFLYER_ID_HERE",
"identity_format":"raw"
}],
"api_version":"0.1",
"property_id": "id1019442026"
}
body = json.dumps(body)
res = requests.request("POST",
"https://hq1.appsflyer.com/gdpr/opengdpr_requests",
headers=headers, data=body, params=params)
print(res.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment