/v2/helplines
1 min
code examples var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //api throughlinecare com/v2/helplines?country code=string\&limit=20\&priority only=boolean", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api throughlinecare com/v2/helplines?country code=string\&limit=20\&priority only=boolean") 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/v2/helplines?country code=string\&limit=20\&priority only=boolean" 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/v2/helplines?country code=string\&limit=20\&priority only=boolean") 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/v2/helplines?country code=string\&limit=20\&priority only=boolean")!,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 // lists the available verified helplines in a given country helplines will be listed in an optimal order using our intelligent ranking algorithm { "helplines" \[ { "id" "crisis text line", "name" "crisis text line", "descriptions" \[ { "language" "en", "fulldescription" "", "shortdescription" "" } ], "website" "https //www crisistextline org/", "country" {}, "timezone" "america/los angeles", "primarytopics" \[ "" ], "secondarytopics" \[ "" ], "supportedlanguages" \[ "" ], "specialties" \[ "" ], "supporttypes" \[ "" ], "interpretationserviceprovided" false, "membershiporganizations" \[ "" ], "contactmethods" \[ { "type" "phone", "value" "1 800 273 8255", "accessibilitynotes" "", "alwaysopen" false, "openinghours" \[ { "localdayofweek" "monday", "open" "2026 04 13t09 00 00+12 00", "close" "2026 04 13t17 00 00+12 00" } ] } ] } ] }// parameters have not been provided or are invalid e g country code has not been provided // unauthorized, token not provided or invalid // access to the requested country or topics is not permitted for the application