Skip to content

Commit

Permalink
chore: script added for adding enumerator
Browse files Browse the repository at this point in the history
  • Loading branch information
geeky-abhishek committed Nov 2, 2023
1 parent 4df8832 commit e59105b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/scripts/enumerator_upload_fusion_auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import requests
import csv
import json
from collections import defaultdict
from decouple import config



url = "https://user-service.staging.anamaya.samagra.io/api/signup"
headers = {'x-application-id': '',
'Content-Type': 'application/json'}

def upload_data(insertions):
insert_fusion_auth_user_request = requests.post(
url, headers=headers, json=insertions)
print("Response: " + insert_fusion_auth_user_request.text)

with open("input/samples/enumerator/users.json", 'r') as file:
users = json.load(file)
for user_id, user_data in users.items():
print("Adding user to Fusion Auth: " + user_id,user_data)
upload_data(user_data)

0 comments on commit e59105b

Please sign in to comment.