FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. Tags
    3. user-api
    Log in to post
    • All categories
    • M

      Solved Invalid JSON error when trying to retrieve users using user API

      Q&A
      • erro json user-api • • munkith.abid
      3
      1
      Votes
      3
      Posts
      3.1k
      Views

      M

      @dan Oops! thank you so much Dan, it worked as a charm. I was fooled into leaving this header in because I tried the exact same request setup using one of these free api endpoints instead of fusionauth api and it worked with the content-type included. Thanks again

    • danD

      User expiration

      Q&A
      • user expiration user-api • • dan
      2
      0
      Votes
      2
      Posts
      3.8k
      Views

      danD

      It means the user won't be able to login.

    • danD

      Updating a user's password and salt

      Q&A
      • user-api password • • dan
      2
      0
      Votes
      2
      Posts
      2.9k
      Views

      danD

      If you’re looking to update the password, you can use the Update User API, or the Change Password API.

      Neither of these APIs accept a hashed password and salt however, it accepts a plain text password that it will in turn salt, hash and then persist.

      Check out both these APIs here: https://fusionauth.io/docs/v1/tech/apis/users

    • danD

      I want to delete all the users created before a certain time

      Q&A
      • bulk delete user-api • • dan
      2
      1
      Votes
      2
      Posts
      3.3k
      Views

      danD

      First, make sure you are using the elasticsearch search engine. You can't run this kind of query on the database search engine.

      Then, you want to use a range query: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html

      You want to build your query string. This is a query string that gives you all the users between the two insertInstants on the user object (inclusive):

      { "range": { "insertInstant": { "gte": 1592231314000, "lte": 1592231315735 } } }

      Omit the gte key if you only want users before a certain time.

      Next is to turn it into an API call against the user search API, which means escaping the query's json and turning it into a JSON object suitable for FusionAuth to parse:

      curl -XPOST -H 'Content-type: application/json' -H "Authorization: $API_KEY" 'https://HOSTNAME/api/user/search?' -d ' { "search" : { "query" : "{\"range\" : { \"insertInstant\" : { \"gte\" : 1592231314000, \"lte\" : 1592231315735}} }"}}'

      Finally, after testing to make sure you're getting the users back you want, you can run the bulk delete API, as documented here: https://fusionauth.io/docs/v1/tech/apis/users#bulk-delete-users

      Tested with Elasticsearch 7.

    • danD

      multi_match query?

      Q&A
      • elasticsearch query user-api • • dan
      4
      0
      Votes
      4
      Posts
      4.8k
      Views

      danD

      It looks like multi match (at least as of 2019) doesn't support wildcards:

      [a] multimatch query requires match queries as its internal queries. And a match query doesn't support wildcards.

      https://discuss.elastic.co/t/query-with-multimatch-and-wildcard/189962

      Can you try with a non wildcard query?

    • danD

      Solved How can I get all users for an application using the API?

      Q&A
      • user search user-api • • dan
      6
      0
      Votes
      6
      Posts
      25.1k
      Views

      danD

      How would I do this kind of search for users within a Postgresql database, I'm not using ElasticSearch.

      Sorry, you cannot.

      Unfortunately you can't search beyond fuzzy matching on the parameters listed in the database search documentation. If you have advanced search needs, we recommend running elasticsearch, which is extremely powerful and flexible.

      Here's a tutorial on switching search engines: https://fusionauth.io/docs/v1/tech/tutorials/switch-search-engines/

    • danD

      Is there a way to update user data in the UI?

      Q&A
      • user-data user-api from-slack faq • • dan
      3
      3
      Votes
      3
      Posts
      7.3k
      Views

      danD

      If you use the advanced registration forms, you can edit user data now. This was recently released as a premium feature (requiring a paid license; more info here).

      More info on setting up the user data editing screen: https://fusionauth.io/docs/v1/tech/guides/advanced-registration-forms/#editing-user-data-in-the-admin-ui

    • danD

      Unable to create a registration using the .NET core client

      Q&A
      • dotnet client-library user-api • • dan
      4
      1
      Votes
      4
      Posts
      11.1k
      Views

      danD

      @robotdan Ah, I missed that. I was looking at the response section, which had the registration. Thanks!