SwapGenerate
Consistent identity - Generate swap
Deprecation notice
This endpoint is deprecated. We recommend using alternative endpoints to ensure continued support and compatibility.
POST
Reserved for premium users
Example:
import requestsimport jsonurl_api = 'https://api.piktid.com/api'face_name = 'face_image_code' # provided by the endpoints /swap/all or /swap/facetarget_name = 'target_image_code' # provided by the endpoints /swap/all or /swap/targetoptions = {}response_g = requests.post(url_api+'/swap/generate',headers={'Authorization': 'Bearer '+TOKEN},data={'face_name':face_name, 'target_name':target_name, 'options':json.dumps(options)},)response_json = json.loads(response_g.text)This function is asynchronous. To retrieve the result, continuously poll (for example every 3 seconds) the /swap/notification_by_name endpoint.
response_n = requests.post(url_api+'/swap/notification_by_name',headers={'Authorization': 'Bearer '+TOKEN},json={'name_list':'swap'},)response_notifications_json = json.loads(response_n.text)swap_image_link = response_notifications_json.get('notifications_list',[])[0].get('data',{}).get('links',[])[0].get('l')token_auth_2header
AuthorizationBearer <token>application/json- body
face_name?stringtarget_name?stringoptions?stringSuccess
application/json- response
msg?stringcurl -X POST "https://example.com/api/swap/generate" \ -H "Content-Type: application/json" \ -d '{}'{ "msg": "string"}