Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohanprabhu-jm/7fe8132259bde1c9b90a3e8f92bdb444 to your computer and use it in GitHub Desktop.
Save rohanprabhu-jm/7fe8132259bde1c9b90a3e8f92bdb444 to your computer and use it in GitHub Desktop.
* Preparing request to http://localhost:8080/v1/delivery-targets?mappedUserId=AY8nA-1a3vV-ObdUF-MBfd7
* Current time is 2020-10-31T19:05:12.235Z
* Using libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libssh2/1.9.0 nghttp2/1.41.0
* Using default HTTP version
* Disable timeout
* Enable automatic URL encoding
* Disable SSL validation
* Enable cookie sending with jar of 2 cookies
* Found bundle for host localhost: 0x15e91c242a80 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#26) with host localhost
* Connected to localhost (127.0.0.1) port 8080 (#26)
> POST /v1/delivery-targets?mappedUserId=AY8nA-1a3vV-ObdUF-MBfd7 HTTP/1.1
> Host: localhost:8080
> User-Agent: insomnia/2020.4.2
> Cookie: JSESSIONID=06689FD6A5448C0753EB20D6DBDE037C
> Content-Type: application/json
> X-Mitter-Application-Id: 9qlSs-hoj3Q-IUC7w-lZnBu
> X-Issued-Mitter-User-Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
> Accept: */*
> Content-Length: 105
| {
| "deliveryTargetId": "dt-fcm-0007",
| "targetType": "fcm",
| "mechanismSpecification": "fcm-token-0007"
| }
* upload completely sent off: 105 out of 105 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200
< X-Mitter-Request-Id: BqRpWJCtKZfPaNpkjOrmQYWTm761O5Pi
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Sat, 31 Oct 2020 19:05:13 GMT
* Received 167 B chunk
* Received 5 B chunk
* Connection #26 to host localhost left intact
* Preparing request to http://localhost:8080/v1/delivery-targets/dt-fcm-0002/subscriptions
* Current time is 2020-10-31T19:03:51.792Z
* Using libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libssh2/1.9.0 nghttp2/1.41.0
* Using default HTTP version
* Disable timeout
* Enable automatic URL encoding
* Disable SSL validation
* Enable cookie sending with jar of 2 cookies
* Found bundle for host localhost: 0x15e91c242a80 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#26) with host localhost
* Connected to localhost (127.0.0.1) port 8080 (#26)
> POST /v1/delivery-targets/dt-fcm-0002/subscriptions HTTP/1.1
> Host: localhost:8080
> User-Agent: insomnia/2020.4.2
> Cookie: JSESSIONID=06689FD6A5448C0753EB20D6DBDE037C
> Content-Type: application/json
> X-Mitter-Application-Id: 9qlSs-hoj3Q-IUC7w-lZnBu
> X-Issued-Mitter-User-Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
> Accept: */*
> Content-Length: 130
| {
| "subscriptionId": "sub-user-0002",
| "@subscriptionType": "user-resolution-subscription",
| "target": "AY8nA-1a3vV-ObdUF-MBfd7"
| }
* upload completely sent off: 130 out of 130 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 409
< X-Mitter-Request-Id: kcQCpnJMciVFwyINoCZsQqR5wmTlkyQN
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Origin: *
< Content-Type: application/json;charset=ISO-8859-1
< Content-Length: 210
< Date: Sat, 31 Oct 2020 19:03:51 GMT
* Received 210 B chunk
* Connection #26 to host localhost left intact
  1. The mechanismSpecification here is the fcm delivery token.
  2. The X-Issued-Mitter-User-Authorization field contains the jwt token that is used to make authenticated mitter.io calls
  3. The target in the create-user-me-subscription payload and the mappedUserId query parameter create-fcm-subscription URL is the user id for which these operations are being performed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment