cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

144
Views
0
Helpful
7
Replies
jamie guo
Beginner

Receive JWT token

Hi:

 

 I receive

`eyJhbGciOiAiZGlyIiwgImtpZCI6ICJrbXM6Ly9rbXMtdXMud2J4Mi5jb20va2V5cy83YzRlNmM5Ny1jMzAyLTQzYzMtYmE5MS1iZDk2NTBmNzRkOTEiLCAiZW5jIjogIkEyNTZHQ00ifQ..v3iME44EPvhov37q.CIXlzg.tXHjceO6JTAn1cNoHSVhG` from websocket, 

 

{
  "alg": "dir",
  "kid": "kms://kms-us.wbx2.com/keys/7c4e6c97-c302-43c3-ba91-bd9650f74d91",
  "enc": "A256GCM"
}

 

7 REPLIES 7
jamie guo
Beginner

This is the Tracking ID

ROUTER_627CBACF-E06E-01BB-4266-0AFE58B64266

It's not clear exactly what you're issue is, can you give a brief description of what you're doing?
I checked the trackingId and found a POST to https://webexapis.com/v1/messages , which seems to fail with a 502 error, is this what you're reporting?

Did you use that JWT as the token to make this request with?

 

If yes, please note that JWTs cannot be used with our APIs. They need to be exchanged for an access token, see here: https://developer.webex.com/docs/guest-issuer#:~:text=Exchanging%20for%20an%20Access%20Token . Once you have exchanged it, you need to ensure the guest user is added to the room where you want to send the message. You would do this with the /create-a-membership API but first you need to get the personId of this guest user, using the /get-my-own-details people API .

 

If your issue is something else, please provide steps on how you reproduced it. Also provide details on the websocket you're using, how it's created and so on.

I have created a bot, and only one of my colleague's messages is a JWT token others are normal messages.

Ok, it's not really clear to me what you mean by that. What do you mean when you say 'one of my colleagues messages is a JWT token' .. Do you mean that one of your colleagues uses a JWT token to create messages or do you mean that the message itself is a JWT token... or something else?


I also don't understand what you mean when you say 'other messages are normal'.

 

I Think it would be best if you explain what the full flow of events is, as in what you are doing exactly and what's being used. If you can provide this in step by step form that would help.

a

 

{
    "id": "0d139e49-fd0c-4c4c-8804-c3b436a4a930",
    "data": {
        "activity": {
            "id": "53ca6cd0-d1df-11ec-81a1-ebf6ac2a1e16",
            "objectType": "activity",
            "url": "https://conv-a.wbx2.com/conversation/api/v1/activities/53ca6cd0-d1df-11ec-81a1-ebf6ac2a1e16",
            "published": "2022-05-12T10:36:05.533Z",
            "verb": "post",
            "actor": {
                "id": "nam.n@binance.com",
                "objectType": "person",
                "displayName": "Nam Nguyen (Infra Tech - UTC+7)",
                "orgId": "25ae0134-b107-42fd-8c63-f776f2300739",
                "emailAddress": "nam.n@binance.com",
                "entryUUID": "0285679a-b824-49ef-8715-530f8cb54e85",
                "type": "PERSON"
            },
            "object": {
                "objectType": "comment",
                "displayName": "eyJhbGciOiAiZGlyIiwgImtpZCI6ICJrbXM6Ly9rbXMtdXMud2J4Mi5jb20va2V5cy83YzRlNmM5Ny1jMzAyLTQzYzMtYmE5MS1iZDk2NTBmNzRkOTEiLCAiZW5jIjogIkEyNTZHQ00ifQ..RoE4yaMuQ23TAQAl.Mb6WIA.p9CwTeN8ML_ArmsPGcCJig"
            },
            "target": {
                "id": "6a1c5450-d1b5-11ec-892f-25f67c216e5e",
                "objectType": "conversation",
                "url": "https://conv-a.wbx2.com/conversation/api/v1/conversations/6a1c5450-d1b5-11ec-892f-25f67c216e5e",
                "published": "2022-05-12T05:36:04.117Z",
                "participants": {
                    "items": []
                },
                "activities": {
                    "items": []
                },
                "deletedActivityIds": [],
                "tags": [
                    "ONE_ON_ONE"
                ],
                "globalId": "Y2lzY29zcGFyazovL3VzL1JPT00vNmExYzU0NTAtZDFiNS0xMWVjLTg5MmYtMjVmNjdjMjE2ZTVl"
            },
            "clientTempId": "1968c6a2-3391-41e2-8a9b-408d77fea519",
            "encryptionKeyUrl": "kms://kms-us.wbx2.com/keys/7c4e6c97-c302-43c3-ba91-bd9650f74d91",
            "vectorCounters": {
                "sourceDC": "a-",
                "counters": {
                    "a-": 27
                }
            }
        },
        "eventType": "conversation.activity"
    },
    "timestamp": 1652351765569,
    "trackingId": "CLIENT_fbb57891-3a39-4268-b3de-0f14f952a475",
    "alertType": "full",
    "headers": {
        "data.activity.target.lastReadableActivityDate": "2022-05-12T10:36:05.533Z",
        "data.activity.target.owningOrg": "25ae0134-b107-42fd-8c63-f776f2300739"
    },
    "sequenceNumber": 918,
    "filterMessage": false
}

If you see from the above json payload I receive from your WebSocket, you'll see the displayName is

eyJhbGciOiAiZGlyIiwgImtpZCI6ICJrbXM6Ly9rbXMtdXMud2J4Mi5jb20va2V5cy83YzRlNmM5Ny1jMzAyLTQzYzMtYmE5MS1iZDk2NTBmNzRkOTEiLCAiZW5jIjogIkEyNTZHQ00ifQ..RoE4yaMuQ23TAQAl.Mb6WIA.p9CwTeN8ML_ArmsPGcCJig

 

So, I use data.activity.id combine it into: ciscospark://us/MESSAGE/53ca6cd0-d1df-11ec-81a1-ebf6ac2a1e16, and base64 it  to call the api

 

/v1/messages/Y2lzY29zcGFyazovL3VzL01FU1NBR0UvNTNjYTZjZDAtZDFkZi0xMWVjLTgxYTEtZWJmNmFjMmExZTE2

 

it return me the

eyJhbGciOiAiZGlyIiwgImtpZCI6ICJrbXM6Ly9rbXMtdXMud2J4Mi5jb20va2V5cy83YzRlNmM5Ny1jMzAyLTQzYzMtYmE5MS1iZDk2NTBmNzRkOTEiLCAiZW5jIjogIkEyNTZHQ00ifQ..RoE4yaMuQ23TAQAl.Mb6WIA.p9CwTeN8ML_ArmsPGcCJig
Create
Recognize Your Peers
Content for Community-Ad