249249 </v-timeline >
250250 </v-col >
251251 <v-col
252- v-if =" $vuetify.breakpoint.lgAndUp"
253252 cols =" 12"
254253 md =" 7"
255- class =" d-flex align-center"
256- :class =" { 'min-h-650': $vuetify.breakpoint.lgAndUp }"
254+ :class =" { 'pt-16 pb-16': $vuetify.breakpoint.lgAndUp }"
257255 >
258- <transition name =" fade" >
259- <v-img
260- v-if =" step1Hover"
261- contain
262- max-height =" 600"
263- :src =" require('assets/img/phone-api-key.png')"
264- ></v-img >
265- </transition >
266- <transition name =" fade" >
267- <v-img
268- v-if =" step2Hover && !step1Hover"
269- contain
270- max-height =" 600"
271- :src =" require('assets/img/phone-login.png')"
272- ></v-img >
273- </transition >
274- <transition name =" fade" >
275- <v-img
276- v-if =" !step1Hover && !step2Hover"
277- contain
278- class =" mt-n16"
279- :src =" require('assets/img/code-snippet.png')"
280- ></v-img >
281- </transition >
256+ <div class =" w-full mt-4" >
257+ <v-tabs v-model =" selectedTab" show-arrows >
258+ <v-tab href =" #javascript" >
259+ <v-icon color =" #efd81d" class =" mr-1" >{{
260+ mdiLanguageJavascript
261+ }}</v-icon >
262+ Javascript
263+ </v-tab >
264+ <v-tab href =" #php" >
265+ <v-icon color =" #777bb3" class =" mr-2" >{{
266+ mdiLanguagePhp
267+ }}</v-icon >
268+ PHP
269+ </v-tab >
270+ <v-tab href =" #go" >
271+ <v-icon color =" #00aed8" class =" mr-2" >{{
272+ mdiLanguageGo
273+ }}</v-icon >
274+ Go
275+ </v-tab >
276+ <v-tab href =" #java" >
277+ <v-icon color =" #0c89c7" class =" mr-2" >{{
278+ mdiLanguageJava
279+ }}</v-icon >
280+ Java
281+ </v-tab >
282+ <v-tab href =" #curl" >
283+ <v-icon color =" primary" class =" mr-2" >{{
284+ mdiPowershell
285+ }}</v-icon >
286+ cURL
287+ </v-tab >
288+ <v-tab href =" #c-sharp" >
289+ <v-icon color =" #68217a" class =" mr-2" >{{
290+ mdiLanguageCsharp
291+ }}</v-icon >
292+ c-sharp
293+ </v-tab >
294+ </v-tabs >
295+ <v-tabs-items v-model =" selectedTab" >
296+ <v-tab-item value =" javascript" >
297+ <pre v-highlight class =" javascript w-full mt-n2 mb-n13" >
298+ <code >let apiKey = "Get API Key from https://httpsms.com/settings";
299+
300+ fetch('https://api.httpsms.com/v1/messages/send', {
301+ method: 'POST',
302+ headers: {
303+ 'x-api-key': apiKey,
304+ 'Accept': 'application/json',
305+ 'Content-Type': 'application/json'
306+ },
307+ body: JSON.stringify({
308+ "content": "This is a sample text message",
309+ "from": "+18005550199",
310+ "to": "+18005550100"
311+ })
312+ })
313+ .then(res => res.json())
314+ .then((data) => console.log(data));
315+ </code >
316+ </pre >
317+ </v-tab-item >
318+ <v-tab-item value =" php" >
319+ <pre v-highlight class =" php w-full mt-n2 mb-n13" >
320+ <code >< ; ?php
321+ // initialize guzzle client https://github.com/guzzle/guzzle
322+ $client = new GuzzleHttp\Client();
323+
324+ $apiKey = "Get API Key from https://httpsms.com/settings";
325+
326+ $res = $client->request('POST', 'https://api.httpsms.com/v1/messages/send', [
327+ 'headers' => [
328+ 'x-api-key' => $apiKey,
329+ ],
330+ 'json' => [
331+ 'content' => 'This is a sample text message',
332+ 'from' => "+18005550199",
333+ 'to' => '+18005550100'
334+ ]
335+ ]);
336+
337+ echo $res->getBody();
338+ </code >
339+ </pre >
340+ </v-tab-item >
341+ <v-tab-item value =" go" >
342+ <pre v-highlight class =" go w-full mt-n2 mb-n13" >
343+ <code >import "github.com/NdoleStudio/httpsms-go"
344+
345+ client := htpsms.New(htpsms.WithAPIKey(/* API Key from https://httpsms.com/settings */))
346+
347+ client.Messages.Send(context.Background(), &httpsms.MessageSendParams{
348+ Content: "This is a sample text message",
349+ From: "+18005550199",
350+ To: "+18005550100",
351+ })
352+ </code >
353+ </pre >
354+ </v-tab-item >
355+ <v-tab-item value =" java" >
356+ <pre v-highlight class =" java w-full mt-n2 mb-n13" >
357+ <code >var client = HttpClient.newHttpClient();
358+
359+ var apiKey = "Get API Key from https://httpsms.com/settings";
360+
361+ JSONObject request = new JSONObject();
362+ request.put("content", "This is a sample text message");
363+ request.put("from", "+18005550199")
364+ request.put("to", "+18005550100")
365+
366+ // create a request
367+ var request = HttpRequest.newBuilder()
368+ .uri(URI.create("https://api.httpsms.com/v1/messages/send"))
369+ .header("accept", "application/json")
370+ .header("x-api-key", apiKey)
371+ .setEntity(new StringEntity(request.toString()))
372+ .POST()
373+ .build();
374+
375+ // use the client to send the request
376+ var response = client.send(request, new JsonBodyHandler<> (APOD.class));
377+
378+ // the response:
379+ System.out.println(response.body().get());
380+ </code >
381+ </pre >
382+ </v-tab-item >
383+ <v-tab-item value =" curl" >
384+ <pre v-highlight class =" bash w-full mt-n2 mb-n13" >
385+ <code >curl --location --request POST 'https://api.httpsms.com/v1/messages/send' \
386+ --header 'x-api-key: Get API Key from https://httpsms.com/settings' \
387+ --header 'Content-Type: application/json' \
388+ --data-raw '{
389+ "from": "+18005550199",
390+ "to": "+18005550100",
391+ "content": "This is a sample text message"
392+ }'
393+ </code >
394+ </pre >
395+ </v-tab-item >
396+ <v-tab-item value =" c-sharp" >
397+ <pre v-highlight class =" c-sharp w-full mt-n2 mb-n13" >
398+ <code >var client = new HttpClient();
399+ client.DefaultRequestHeaders.Add("x-api-key", ""/* Get API Key from https://httpsms.com/settings */);
400+
401+ var response = await client.PostAsync(
402+ "https://api.httpsms.com/v1/messages/send",
403+ new StringContent(
404+ JsonSerializer.Serialize(new {
405+ from = "+18005550199",
406+ To = "+18005550100",
407+ Content = "This is a sample text message",
408+ }),
409+ Encoding.UTF8,
410+ "application/json"
411+ )
412+ );
413+
414+ Console.WriteLine(await response.Content.ReadAsStringAsync());
415+ </code >
416+ </pre >
417+ </v-tab-item >
418+ </v-tabs-items >
419+ </div >
282420 </v-col >
283421 </v-row >
284422 </v-col >
291429 <v-btn
292430 text
293431 rounded
432+ outlined
294433 class =" my-2"
295434 :href =" $store.getters.getAppData.documentationUrl"
296435 >Documentation</v-btn
299438 text
300439 rounded
301440 class =" my-2"
441+ outlined
302442 :href =" $store.getters.getAppData.githubUrl"
303443 >Open Source</v-btn
304444 >
@@ -328,6 +468,12 @@ import {
328468 mdiTallyMark1 ,
329469 mdiTallyMark3 ,
330470 mdiTallyMark2 ,
471+ mdiLanguageJavascript ,
472+ mdiLanguagePhp ,
473+ mdiLanguageCsharp ,
474+ mdiLanguageJava ,
475+ mdiPowershell ,
476+ mdiLanguageGo ,
331477} from ' @mdi/js'
332478
333479export default Vue .extend ({
@@ -345,8 +491,13 @@ export default Vue.extend({
345491 mdiTallyMark1 ,
346492 mdiTallyMark2 ,
347493 mdiTallyMark3 ,
348- step1Hover: false ,
349- step2Hover: false ,
494+ mdiLanguageJavascript ,
495+ mdiLanguagePhp ,
496+ mdiLanguageCsharp ,
497+ mdiLanguageJava ,
498+ mdiPowershell ,
499+ mdiLanguageGo ,
500+ selectedTab: ' javascript' ,
350501 }
351502 },
352503})
0 commit comments