AhmedMagdy7 commited on
Commit
b4d8ed2
1 Parent(s): c1ce398
Files changed (1) hide show
  1. api call +30 -0
api call ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const response = await fetch(
2
+ "https://api.magicflow.ai/workflow/d5fcc41f-4358-4389-ae01-a09cca1a2b74/job",
3
+ {
4
+ method: "POST",
5
+ headers: {
6
+ "Content-Type": "application/json",
7
+ "Authorization": "Token rQR05YX61Y34driX8udVRiuvIW+T1zdEJ5sJiNn2kGxYC+B8tLZTt3sPXB0/DYmS"
8
+ },
9
+ body: JSON.stringify({
10
+ mock: false,
11
+ params: {
12
+ face_url: "...",
13
+ gender: "...",
14
+ }
15
+ })
16
+ }
17
+ );
18
+
19
+
20
+ #The response will contain a jobId.
21
+ #Then to fetch the results through the API call:
22
+ const response = await fetch(
23
+ "https://api.magicflow.ai/workflow/d5fcc41f-4358-4389-ae01-a09cca1a2b74/jobs/[job-id]/results",
24
+ {
25
+ headers: {
26
+ "Content-Type": "application/json",
27
+ "Authorization": "Token rQR05YX61Y34driX8udVRiuvIW+T1zdEJ5sJiNn2kGxYC+B8tLZTt3sPXB0/DYmS",
28
+ },
29
+ }
30
+ );