Adil Hemache
Adil Hemache
KKinde
Created by Adil Hemache on 9/12/2024 in #💻┃support
how to set provided_id when creating user via management API?
@Daniel_Kinde so there is no way to set/get provided_id via the api?! should we just use custom property?
12 replies
KKinde
Created by Adil Hemache on 9/12/2024 in #💻┃support
how to set provided_id when creating user via management API?
@Andre @ Kinde to reword our needs, we want to 1. set provided_id when creating the user using management API 2. able to get that provided_id later when listing users using management API note aside, the API documentations looks out dated and hard to follow
12 replies
KKinde
Created by Adil Hemache on 9/12/2024 in #💻┃support
how to set provided_id when creating user via management API?
@Andre @ Kinde got all user identities, still, provided_id is not part of any GET /api/v1/users/{user_id}/identities
{'code': 'OK',
'has_more': False,
'identities': [{'created_on': '2024-09-14T18:15:52.950703+00:00',
'id': 'identity_0191f1bf9fad251c79f2c959be828fe8',
'is_confirmed': False,
'last_login_on': None,
'name': '[email protected]',
'total_logins': 0,
'type': 'email'}],
'message': 'Success'}
{'code': 'OK',
'has_more': False,
'identities': [{'created_on': '2024-09-14T18:15:52.950703+00:00',
'id': 'identity_0191f1bf9fad251c79f2c959be828fe8',
'is_confirmed': False,
'last_login_on': None,
'name': '[email protected]',
'total_logins': 0,
'type': 'email'}],
'message': 'Success'}
12 replies
KKinde
Created by Adil Hemache on 9/12/2024 in #💻┃support
how to set provided_id when creating user via management API?
yes, but the documentation says that provided_id field is part of user response and not identity! assuming I want to use get identity endpoint, what's the ID of the identity ? 🤔 as I only create one primary email identity in user creation request
12 replies
KKinde
Created by Adil Hemache on 9/12/2024 in #💻┃support
how to set provided_id when creating user via management API?
@Andre @ Kinde full script with config and everything, easier to debug 🙏 ps: I made sure the M2M app has read/write to all user and user_properties scopes
12 replies
KKinde
Created by Adil Hemache on 9/12/2024 in #💻┃support
how to set provided_id when creating user via management API?
to get provided_id I tried following requests: GET /api/v1/users GET /api/v1/user GET /users/kp_38c012726fe243f8b0e55aaa964d19a7/properties
12 replies
KKinde
Created by Adil Hemache on 9/12/2024 in #💻┃support
how to set provided_id when creating user via management API?
@Andre @ Kinde it didn't work 😕 I can't retrieve provided_id nor see it in Kinde admin dashboard UI
python
r = api.post(f"/user", json={
# * must be a string
"provided_id": str(1000),
"profile": {
"given_name": "Test",
"family_name": "Test",
},
"organization_code": "org_d0ac253eda2",
"identities": [{
"type": "email",
"details": { "email": "[email protected]" },
}]
})
pprint(r.json())
r = api.get('/user', params={"id": r.json().get("id")})
print('#' * 100)
pprint(r.json())
python
r = api.post(f"/user", json={
# * must be a string
"provided_id": str(1000),
"profile": {
"given_name": "Test",
"family_name": "Test",
},
"organization_code": "org_d0ac253eda2",
"identities": [{
"type": "email",
"details": { "email": "[email protected]" },
}]
})
pprint(r.json())
r = api.get('/user', params={"id": r.json().get("id")})
print('#' * 100)
pprint(r.json())
log
{'created': True,
'id': 'kp_38c012726fe243f8b0e55aaa964d19a7',
'identities': [{'result': {'created': True, 'identity_id': 73},
'type': 'email'}]}
####################################################################################################
{'created_on': '2024-09-13T18:41:06.746997+00:00',
'failed_sign_ins': 0,
'first_name': 'Test',
'id': 'kp_38c012726fe243f8b0e55aaa964d19a7',
'is_suspended': False,
'last_name': 'Test',
'preferred_email': '[email protected]',
'total_sign_ins': 0}
{'created': True,
'id': 'kp_38c012726fe243f8b0e55aaa964d19a7',
'identities': [{'result': {'created': True, 'identity_id': 73},
'type': 'email'}]}
####################################################################################################
{'created_on': '2024-09-13T18:41:06.746997+00:00',
'failed_sign_ins': 0,
'first_name': 'Test',
'id': 'kp_38c012726fe243f8b0e55aaa964d19a7',
'is_suspended': False,
'last_name': 'Test',
'preferred_email': '[email protected]',
'total_sign_ins': 0}
12 replies