Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity Remote Config API Problem

Discussion in 'Unity Remote Config' started by MrRobinJohannesson, Feb 27, 2020.

  1. MrRobinJohannesson

    MrRobinJohannesson

    Joined:
    Jul 15, 2017
    Posts:
    13
    Hi, I having problem with Unity's remote config api. In their docs it says: "In the POST payload below, replace [username] and [password] with your Unity account login information". However I can't seem to figure it out. What username do they want? My email or display name.

    I tried both options and nothing works. I am doing something wrong or is API not completed?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you specify which call you are trying to make, and the syntax that you are using? https://remote-config-api-docs.uca.cloud.unity3d.com/
     
  3. MrRobinJohannesson

    MrRobinJohannesson

    Joined:
    Jul 15, 2017
    Posts:
    13
    Authentication call, getting 400 syntax error.

    curl --header "Content-Type: application/json" --request POST --data '{"username":"[username]","password":"[password]","grant_type":"PASSWORD"}' https://api.unity.com/v1/core/api/login

    Tried a different online curl website. One is giving me 401 error and says: "Invalid Credential" and the other is giving me 400 error.
     
    Last edited: Feb 27, 2020
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I just tried it, and I believe I see the issue. The JSON should be formed like "username:email@domain.com" (there are no actual brackets). I'm on Windows, so I need to use the \ escape character, but my working request is:

    curl --header "Content-Type: application/json" --request POST --data "{\"username\":\"me@domain.com\",\"password\":\"mypassword\",\"grant_type\":\"PASSWORD\"}" https://api.unity.com/v1/core/api/login
     
  5. MrRobinJohannesson

    MrRobinJohannesson

    Joined:
    Jul 15, 2017
    Posts:
    13
    Now it worked, thank you =)
     
    vd_unity and JeffDUnity3D like this.