Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    wenjdu
    @wenjdu
    and compare
    it shouldn't be your main device id in the publication
    GiacL
    @GiacL

    04-16 13:39:55.432 11508-11508/ch.giacomolonghi.unilapp D/pinid: 40bdeb11-b03a-4823-81bb-33b99e5cfbf2

    04-16 13:39:55.457 11508-11508/ch.giacomolonghi.unilapp D/TARTATIN: Publication(topic=conference, range=3330.0, duration=3330.0, properties={}, deviceId=448af123-5b92-4b2b-b249-160b57434c2b, worldId=null, createdAt=1523878795430, id=6a564909-871f-403b-9920-82df8bd61c3c)

    wenjdu
    @wenjdu
    Can you matchmore.createPublication(yourPublication, "40bdeb11-b03a-4823-81bb-33b99e5cfbf2")
    Try it like that and give me the log again
    GiacL
    @GiacL
    04-16 13:46:21.858 12556-12556/ch.giacomolonghi.unilapp D/TARTATIN: Publication(topic=conference, range=3330.0, duration=3330.0, properties={}, deviceId=40bdeb11-b03a-4823-81bb-33b99e5cfbf2, worldId=null, createdAt=1523879181841, id=2e825852-a1de-41f2-9d10-c46722e6783b)
    wenjdu
    @wenjdu
    ok see you are publishing on the right device id now
    GiacL
    @GiacL
    yeah but i put the String directly, i can't put that in a variable?
    wenjdu
    @wenjdu
    So I think the issue is related with the value you store inside of your variable this.pinID
    GiacL
    @GiacL
    ok, thank you
    wenjdu
    @wenjdu
    Yes you definately can but be careful with the callbacks
    GiacL
    @GiacL
    thanks
    wenjdu
    @wenjdu

    When there is asynchronous calls, you have to make sure that async call One is finished before async call Two is launched. Especially, when you need a value that is returned with async call One.

    In your case, you have pinID which is supposed to be store at the end of the async call One, but if your async call Two is called before async call One is done. Then you will have pinID = null, which lead to the case where createPublication(publication, null) == you create a publication for your main device.

    arthfr
    @arthfr
    Bonjour, quel type d'infrastructure (en terme de serveur) utilisez-vous ?
    Pour un projet universitaire
    elsener
    @elsener
    Bonjour @arthfr, notre service fonctionne dans le Cloud (GCloud) et pour l'utiliser vous n'avez pas besoin d'infrastructure de votre côté. Nos sdks communiquent avec le backend directement. Est-ce que cela répond à votre question?
    Arnaud de Charrière de Sévery
    @Ohmere03

    Hi, I'm trying to make a publication from a server in Java. If I understood correctly, I need to make a post request on your rest api using this url: https://api.matchmore.io/v5/devices/{deviceId}/publications

    Then I need to replace the brackets of the deviceId by my deviceId. However, I still have the following question: how do I structure the header of the request? Do I only need the api key ? or should I put any username and password encrypted too?

    For example taking this code:
    ´´´
    HttpPost createConnectivity(String restUrl, String username, String password)
    {
    HttpPost post = new HttpPost(restUrl);
    String auth=new StringBuffer(apiKey).toString();
    byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(Charset.forName("UTF-8")));
    String authHeader = "Basic " + new String(encodedAuth);
    post.setHeader("AUTHORIZATION", authHeader);
    post.setHeader("Content-Type", "application/json");
    post.setHeader("Accept", "application/json");
    post.setHeader("X-Stream" , "true");
    return post;
    }

    ´´´
    Would it be the correct approach for the header?

    Adam Smolarek
    @adamsmo
    there is no need for user and password
    only apiKey
    nico368
    @nico368

    Hello, I'm trying to do the same as Arnaud, But I get a HandShake_Failure.
    This is my code: Do I need to specify authentication somewhere?

    ....
    public class Test {
    public static void main(String[] args) throws IOException {
    URL url = new URL("https://api.matchmore.io/v5/devices/{deviceId}/publications");
    HttpsURLConnection httpCon = (HttpsURLConnection) url.openConnection();
    httpCon.setDoOutput(true);
    httpCon.setRequestMethod("POST");
    OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
    System.out.println(httpCon.getResponseCode());
    System.out.println(httpCon.getResponseMessage());
    out.close();
    }
    }

    Łukasz Młynik
    @lmlynik
    @nico368 what is your device id?
    Łukasz Młynik
    @lmlynik
    also, yes, you need toto provide your appi key just like @Ohmere03
    you just need to call setHeader("AUTHORIZATION", "<your api key>");
    you don't need to wrap it in any Basic digests
    nico368
    @nico368

    public class AndNico1 {

    public static void main(String[] args) throws IOException {
    
        HttpPost url = new HttpPost("https://api.matchmore.io/v5/devices/a2dee2ed-9996-41cf-af07-996c9a576472/publications");
          String apiKey;
        apiKey = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJhbHBzIiwic3ViIjoiYjBhM2M3ZGQtMGUyMC00MDk3LTkwNmYtYjY0NjA5MzU3Y2VjIiwiYXVkIjpbIlB1YmxpYyJdLCJuYmYiOjE1MjA1MDg5NjcsImlhdCI6MTUyMDUwODk2NywianRpIjoiMSJ9.TzV_vFEjs1XlK5WeSwHnKurYSNrS28qllVaQDg8SEtcfA4AwxtvZSHCPliKkFVouD7nQiStz-rN2Rlh26KObQA";
        url.setHeader("AUTHORIZATION", apiKey);

    }
    }

    I don't have the handshake issue anymore. Thanks

    Simple question, the deviceId, worldId etc. should be in a json file or should they be added as params?

    thanks
    Łukasz Młynik
    @lmlynik
    as specified in the api documentation, not sure what json file are you referring to
    nico368
    @nico368

    in the API documentation, all that is given is this sample:

    {
    "worldId": "string",
    "deviceId": "string",
    "topic": "string",
    "range": 0,
    "duration": 0,
    "properties": {
    "band": "Metallica",
    "tags": [
    "rock",
    "metal"
    ],
    "price": 400,
    "currency": "CHF",
    "free_parking": true
    }
    }

    When creating a publication, do we send this requested Body all in the Header, or in a Json Object, or which way?

    Łukasz Młynik
    @lmlynik
    this is the body
    nico368
    @nico368
    Alright, thanks. I think I got it, Will run a few test and if I have an issue, will come back. Thanks, great support!
    nico368
    @nico368
    Hi, me again, I'm struggling to understand how the server wishes to receive the body. Is it as a json, what is the format that the server accepts and comprehends?
    Łukasz Młynik
    @lmlynik
    it is all json
    the body takes json
    remember to specify content headers for json
    nico368
    @nico368
    do I specify it as "BODY" or how does it want it specified?
    Łukasz Młynik
    @lmlynik
    its standard http
    post.setHeader("Accept", "application/json"); post.setHeader("Content-type", "application/json");
    in the response you should receive before all a response code, its http again :)
    for creation of resources, REST specification(in essence opinionated HTTP) says all resource creation(device,pub,sub) should return 201
    nico368
    @nico368
    Thanks, we managed to make it work.
    :)
    Henry Decléty
    @henrydeclety
    Hi, does anyone has sample code or documentation for using websocket in javascript? It is missing from the documentation in matchmore.io..
    Thanks
    Łukasz Młynik
    @lmlynik
    hey, so currently there is a gap in the documentation around using websockets directly. The match monitors are an abstraction above the websockets and polling
    we are in the process of prepairing such documentation for websockets so people are able to implement their own SDKs
    makni-sahar
    @makni-sahar
    Hello, I want to know if I can retrieve all the publications (having different topics and properties) around with no specific topic or selections? Thanks :)
    Alpha Diallo
    @alphasldiallo
    Hello Makni-Sahar
    It's mandatory to provide a topic
    But if you are stuck on your project because of this parameter, please feel free to send us an email. We will be glad to assist you
    makni-sahar
    @makni-sahar
    thank you :)