/v1/helplines/{helpline_id}
1 min
GET
https://api.throughlinecare.com/v1/helplines/{helpline_id}
Path Parameters
- helpline_idstringrequiredDescription
Responses
200
- objectDescription
- helplineHelplineV1Description
- idstringrequiredExampleDescription
- namestringrequiredExampleDescription
- descriptionstringExampleDescription
- shortDescriptionstringExampleDescription
- websitestring<uri>ExampleDescriptionFormaturi
- countryobjectrequired
- Country
- namestringrequiredExampleDescription
- codestringrequiredExampleDescription
- emergencyNumberstringExampleDescription
- timezonestringrequiredExampleDescription
- topicsstring[]requiredDescription
- supported_languagesstring[]requiredExample
[ "en", "es", "fr" ]
Description - specialtiesstring[]requiredDescription
- supportTypesstring[]Description
- hoursobject
- Hours
- alwaysOpenbooleanrequiredDescription
- periodsPeriod[]requiredDescription
- dayinteger<int32>requiredExampleDescriptionFormatint32
- openstring<time>requiredExampleDescriptionFormattime
- closestring<time>requiredExampleDescriptionFormattime
- phoneNumberstringExampleDescription
- smsNumberstringExampleDescription
- webChatUrlstring<uri>ExampleDescriptionFormaturi
- whatsappUrlstring<uri>ExampleDescriptionFormaturi
400
403
404
javascript
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/v1/helplines/{helpline_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
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
python
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)
java
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();swift
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()
200
// Returns the helpline matching the unique identifier.
{
"helpline": {
"id": "crisis-text-line",
"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.",
"shortDescription": "24/7 free crisis support for youth in NZ",
"website": "https://www.crisistextline.org/",
"country": {},
"timezone": "America/Los_Angeles",
"topics": [
""
],
"supported_languages": [
""
],
"specialties": [
""
],
"supportTypes": [
""
],
"hours": {},
"phoneNumber": "1-800-555-1212",
"smsNumber": "741741",
"webChatUrl": "https://connect.crisistextline.org/chat?utm_source=findahelpline",
"whatsappUrl": "https://wa.me/1-800-555-1212"
}
}400
// Unique identifier is missing
403
// The helpline does support any of the permitted countries or topics for the application.
404
// Helpline not found