API
...
helplines
/helplines/{helpline_id}
1 min
code examples var request = require('request'); var options = { 'method' 'get', 'url' 'https //api throughlinecare com/v1/helplines/{helpline id}', 'headers' { 'accept' 'application/json', 'content type' 'application/json' } }; request(options, function (error, response) { if (error) throw new error(error); console log(response body); }); require "uri" require "json" require "net/http" url = uri("https //api throughlinecare com/v1/helplines/{helpline id}") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = https request(request) puts response read body import requests import json url = "https //api throughlinecare com/v1/helplines/{helpline id}" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) okhttpclient client = new okhttpclient() newbuilder() build(); mediatype mediatype = mediatype parse("application/json"); requestbody body = requestbody create(mediatype, ""); request request = new request builder() url("https //api throughlinecare com/v1/helplines/{helpline id}") method("get", body) addheader("accept", "application/json") addheader("content type", "application/json") build(); response response = client newcall(request) execute();var request = urlrequest(url url(string "https //api throughlinecare com/v1/helplines/{helpline id}")!,timeoutinterval double infinity) request addvalue("application/json", forhttpheaderfield "accept") request addvalue("application/json", forhttpheaderfield "content type") request httpmethod = "get" let task = urlsession shared datatask(with request) { data, response, error in guard let data = data else { print(string(describing error)) return } print(string(data data, encoding utf8)!) } task resume() responses // returns the helpline matching the unique identifier { "id" "123e4567 e89b 12d3 a456 426655440000", "name" "crisis text line", "description" "crisis text line is here to help you, whatever you're going through we provide 24/7, free and confidential support and information by text message (text home to 741 741), online chat and whatsapp (+1 443 787 7678) we are available to talk with you about any kind of experience relating to mental health, including anxiety, depression, self harm, stress, and thoughts of suicide ", "website" "https //www crisistextline org/", "country" { "name" "new zealand", "code" "nz", "emergencynumber" "111" }, "timezone" "america/los angeles", "topics" \[ "" ], "supported languages" \[ "" ], "specialties" \[ "" ], "supporttypes" \[ "" ], "hours" { "alwaysopen" false, "periods" \[ { "day" "1", "open" "09 00", "close" "17 00" } ] }, "phonenumber" "1 800 555 1212", "smsnumber" "741741", "webchaturl" "https //connect crisistextline org/chat?utm source=findahelpline", "whatsappurl" "https //wa me/1 800 555 1212" }// unique identifier is missing // the helpline does support any of the permitted countries or topics for the application // helpline not found