<turbo-stream action="update" target="wiki__subpage_3723_info"><template>
<p>Read messages from the API using a specific thread ID. </p>
<p> Examples both in JSON and JSONAPI are provided.</p>
<p>NOTE: Remember to substitute the token (after Bearer) and the service id (the "[SERVICE ID]" below) to your own token and service id.</p>
<p></p>
<p></p><h2>JSON:</h2><p></p>
<pre class="card">curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/json" 
  -H "Accept: application/json"
  -X GET
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/messages?threadid=2018092690450Thread
</pre>
<p>An example of out-put:</p>
<pre class="card">{
  "threadid":"20180926090450Thread",
  "message":"Reading layout from NAVODATA004.\nRemoving existing design in configuration.\nDeleting existing layout from cookies.\nAdding new design in configuration - records: 1000\nAdding new design in configuration - records: 2000\nAdding new design in configuration - records: 3000\nAdding new design in configuration - records: 4000\nAdding new design in configuration - records: 4343\nAdding new layout to cookies - records: 1000\nAdding new layout to cookies - records: 2000\nAdding new layout to cookies - records: 3000\nAdding new layout to cookies - records: 4000\nAdding new layout to cookies - records: 4343\nFinished reading layout from NAVODATA004.\",
  "done": true
}
</pre>
<p>This out-put indicates that the messsage has finished.</p>
<pre class="card">{
  "threadid":"20180926090450Thread",
  "message":"",
  "done": true
}
</pre>
<p></p><h2>JSONAPI:</h2><p></p>
<pre class="card">curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X GET
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/messages?threadid=20180926090450Thread
</pre>
<p>The out-put for this example would be:</p>
<pre class="card">{
  "data":{
    "type":"messages",
    "attributes":{ 
      "threadid":"20180926090450Thread",
      "message":"Reading layout from NAVODATA004.\nRemoving existing design in configuration.\nDeleting existing layout from cookies.\nAdding new design in configuration - records: 1000\nAdding new design in configuration - records: 2000\nAdding new design in configuration - records: 3000\nAdding new design in configuration - records: 4000\nAdding new design in configuration - records: 4343\nAdding new layout to cookies - records: 1000\nAdding new layout to cookies - records: 2000\nAdding new layout to cookies - records: 3000\nAdding new layout to cookies - records: 4000\nAdding new layout to cookies - records: 4343\nFinished reading layout from NAVODATA004.\",
      "done": true}"
    }
  }
}
</pre>
<p>This output indicates that the message has finished.</p>
<pre class="card">{
  "data":{
    "type":"messages",
    "attributes":{
      "threadid":"20180926090450Thread",
      "message":"", 
      "done": true
    }
  }
}
</pre>
</template></turbo-stream>
<turbo-stream action="prepend" target="flash"><template></template></turbo-stream>
