0

I'm new to notion api. I'm trying to create a test user in notion using both notion api and notion scim api but both are giving me errors. I'm doing this in postman.

Using notion api, I'm doing a post to create the account

    POST: https://api.notion.com/v1/users
    Headers: Notion-Version:2022-06-28
         Authorization: Bearer (Secret Token)
         Content-Type: application/json  
Body type is raw
{
    "name": "Test Employee",
    "type": "person",
    "person": {
        "email": "temployee001@beyondfinance.com"
    }
}

Running into error message: { "object": "error", "status": 400, "code": "invalid_request_url", "message": "Invalid request URL." }

**I have tried with just the email and name or both but still getting the same error message. **

Using notion scim api, I'm sending the following:

    POST: https://api.notion.com/scim/v2/Users
    Headers: Notion-Version:2022-06-28
         Authorization: Bearer (Secret Token)
         Content-Type: application/json  
         
    Body type is raw
{
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "userName": "temployee001@beyondfinance.com",
    "name": {
        "givenName": "Test",
        "familyName": "Employee"
    },
    "emails": [
        {
            "value": "temployee001@beyondfinance.com",
            "primary": true
        }
    ]
}

The scims api creates the user successfully if I send just the userName, but throws an error when I include the name or name and emails. I need the user to be created with both a name and email.

Error Message: 

`{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:Error"
    ],
    "status": "500"
}`

explorer
  • 1
  • 1

1 Answers1

0

It worked using the scim api. It turned out the user already existed and kept throwing the 500 error whenever I tied to send the request.I just had to delete the user and try again.

The other api just didn’t work at all regardless

explorer
  • 1
  • 1